+ 2
Indentation error in python
https://code.sololearn.com/cvsHhCa6lVXK/?ref=app anyone help me to solve this indentation error I'm a beginner to python
4 ответов
+ 8
#edited part of your code , maha Lakshmi actually you have to put indentation after every if , elif statement and else other things are good👍🏻
N1=int(input())
N2=int(input())
if N1<N2:
print(N2)
else :
print(N1)
#edited instead of elif that you have used you can tooo use else in replace of elif although your required output shows but as they are TWO conditions : Use if and else only
+ 7
there should one other point to consider besides the indentation issue.
since we have only 2 elements to compare, we don't need an *elif* statement with a second conditional. we can use just *else:*
N1=int(input())
N2=int(input())
if N1<N2:
print(N2)
else:
print(N1)
+ 3
Code indentation play important role in python u cannot avoid if you using vs code or any other ide they provide intelligence auto writing, code formatting features you can easily format your code.