0

Whats wrong with this code?

I tryed out something while learning and I don't rly understand what the mistake is... Can someone help me please? Thank you guys https://code.sololearn.com/czq99i9cu1A5/?ref=app

22nd Jun 2019, 2:55 PM
Tim Steiner
4 Réponses
+ 2
polargnome I was able to correct the mistake. Thank you Faisal and Pulkit Kamboj !
22nd Jun 2019, 3:13 PM
Tim Steiner
+ 7
The mistake seems to be that you added indentation on lines 4 and 5 when you didn't need to have an indent there. Getting rid of the space before those 2 lines should allow it to run without problem
22nd Jun 2019, 2:59 PM
Faisal
Faisal - avatar
+ 1
num = int(input('Number:')) if num < 5: print('Less than 5') if num > 5: print('Bigger than 5') There is indentation problem, if you are using the way are doing, it means that the second if is nested in the first if so only if both conditions are correct then only it will execute, also you can use an else instead of second if
22nd Jun 2019, 3:02 PM
Pulkit Kamboj
Pulkit Kamboj - avatar
0
I tried your code and wrote "3" as input when asked. It worked properly
22nd Jun 2019, 3:08 PM
polargnome