+ 1

Hey guys can any one tell why this code is not working

num = int(input("enter a number:")) if num < 5: print("less than 5") if num >= 5: print("Between 5 and 47") the ouptput I get is enter a number:

2nd Sep 2017, 8:08 AM
Abhishek Singh
Abhishek Singh - avatar
2 ответов
+ 3
the 2nd if statement is nested in the 1st one so it only works with a number less than 5.
2nd Sep 2017, 8:18 AM
Enzo
Enzo - avatar
+ 2
thanks @enzo
2nd Sep 2017, 8:19 AM
Abhishek Singh
Abhishek Singh - avatar