+ 1
why is indentation error occur in pythen
5 odpowiedzi
+ 5
a=5
if a==5:
print('yes')
else:
print('no')
This is correct version of your code.
Python does not supports {}(Curly Braces) to define a block. Instead of {} it uses indentation. For indentation you can use spaces and tabs. But the number of space or tabs before various line in same block should same.
In the above code you has a space before if statement that was the problem
😁
+ 3
thank you deepak and olin
+ 1
a=5
if a==5:
print('yes')
else:
print('no')
+ 1
a=5
if a==5:
print('yes')
else:
print('no')
you dont need to add spaces before the if statement
0
can you send the code