3 ответов
0
there's indentation error in many places. the print statement is in the same line with if statement this code works: https://code.sololearn.com/cnM1YC7g0C8G/?ref=app
21st Oct 2018, 4:11 AM
Ayushman Sen
Ayushman Sen - avatar
+ 2
There is actually only a few rules you need to follow: Whenever a line ends with a colon (:), the indentation level is increased by one. Everything that belongs together has the same indentation level. In other languages you use {}: if(condition) { code block; } some other code; "code block" is executed if "condition" is true. "some other code" doesn't belong to the if statement as it is outside of the brackets {}. It's the same concept in python, but you use indentation: if condition: statement statement statement statement other statement All "statements" are executed if condition is True because they are indented. "other statement" does not belong to the if statement because it is not indented
21st Oct 2018, 5:10 AM
Anna
Anna - avatar
0
is there a tut i can watch so j can get good at indenting Ayushman Sen
21st Oct 2018, 4:26 AM
SheZco
SheZco - avatar