+ 1

The code is showing error

n = int(input()) if n in range(2,5) and n%2==0 or n>20: print("Not Weid") if n in range(6,20) and n%2==0 or n!=20: print("Weid")

8th Dec 2021, 12:00 AM
Nisha
4 Respostas
+ 5
Actually your code is not proper indented after if condition u need to give some tabs your code don't have any logical errors n = int(input()) if n in range(2,5) and n%2==0 or n>20: print("Not Weid") if n in range(6,20) and n%2==0 or n!=20: print("Weid")
8th Dec 2021, 1:45 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 3
Nisha it's ok, you just didn't indent it n = int(input()) if n in range(2,5) and n%2==0 or n>20: print("Not Weid") if n in range(6,20) and n%2==0 or n!=20: print("Weid")
8th Dec 2021, 12:47 AM
Luz
Luz - avatar
+ 1
It says expected an indentad block
8th Dec 2021, 12:22 AM
Nisha
+ 1
Indentation is very important in python.
8th Dec 2021, 3:59 PM
Vishal Pandey