Reputation: 203
n = int(input('enter no.'))
if (n % 2) != 0 or n > 6 and n < 20 == True:
print('weird')
else:
print('not weird')
if I run the above code, I get the above error.
Upvotes: 0
Views: 42
Reputation: 77
Try this:
if (n % 2) != 0 or n > 6 and n < 20:
print('weird')
else:
print('not weird')
Your original code was not properly indented.
Also, please check your logical criterion. It seems a bit weird.
Upvotes: 1
Reputation: 67
There is an indentation issue with this is what I can say, otherwise I am getting the perfect results.
Try this :
n = int(input('enter no.'))
if (n % 2) != 0 or n > 6 and n < 20 == True:
print('weird')
else:
print('not weird')
Upvotes: 1