I have a problem with ‘break’ in the following code.
x='Shomik' if(type(x) is str): x=x+' '+"rocks" # Line 3 print('hello') else: x=x+' '+'Python' break # Line 7 print('hi') print(x)
This gives a SyntaxError: ‘break’ outside loop. I dont understand why. Please help.