We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
n = int(input('Enter the number:'))
if (n % 2) == 0:
if n in range(2,5):
print ('Not weird')
elif n in range(6,20):
print ('weird')
elif n > 20:
print ('Not weird')
else:
print ('weird')
Python If-Else
You are viewing a single comment's thread. Return to all comments →
n = int(input('Enter the number:')) if (n % 2) == 0: if n in range(2,5): print ('Not weird') elif n in range(6,20): print ('weird') elif n > 20: print ('Not weird') else: print ('weird')