+ 3
Why intendation is important when coading if and else?
x=10 if x>11: print('True') else : print('False')
1 Antwort
+ 11
indentation is python is very important it's not only for code readability but to also indicate a block of code.
once a python interpreter sees this
if x>11:
the interpret would know that any statements with indentation of 1 tab are its block and would execute accordingly until it sees a change in indentation like else:.