0
Indentation error in break,can someone help.
x=input() print("ch") if x==1: print("ch1") break elif x==2: print("ch2")
10 ответов
+ 4
you use break in loops.
x=input()
print("ch")
if x=="1":
print("ch1")
elif x=="2":
print("ch2")
+ 3
Break is more indented than print. That's verboten. It has to be on the same indentation level:
if x == 1:
print()
break
+ 2
I guess you have used an extra space before the break statement and possibly before 3rd print statement. But I'm not sure.
Please re-indentate your code.✌🏼
+ 2
Please upload your code to the code playground and post a link here
+ 1
I tried that
But it's still not working
+ 1
It's stil not working,did it run in yours?
If i'm keeping break in line with print then it's causing 'error break outside loop' and else it's causing indentation error
+ 1
Choe thanks but i saw somehere on the internet they used break with if condition and it was running without any error,
+ 1
Even in this app's tutorial they have used if with break.