+ 1

Showing error: expected an indented block

num=12 if num>5: print("Bigger than 5") if num<=47: print("Between 5 and 47") On second print statement it highlights and showing error : expected an indented block. I can't understand plz help

18th Apr 2019, 8:31 AM
Vishal Srivastava
Vishal Srivastava - avatar
2 Answers
+ 4
Reformat the code it will fixed num = 12 if num>5: print ("Bigger than ") if num<=47: print ("Between 5 and 47")
18th Apr 2019, 8:38 AM
Ramshek Rana
Ramshek Rana - avatar
+ 3
What Ramshek Rana said, but logically, your code has to look like this: num = 12 if num>5: print ("Bigger than 5") if num<=47: print ("Between 5 and 47") Otherwise, it will print "between 5 and 57" for num = 2
18th Apr 2019, 9:35 AM
Anna
Anna - avatar