Check Tutorial tab to know how to solve.  

Task 

Given an integer, $n$, perform the following conditional actions:

If $n$ is odd, print Weird
If $n$ is even and in the inclusive range of $2$ to $5$, print Not Weird
If $n$ is even and in the inclusive range of $\boldsymbol{6}$ to $\textbf{20}$, print Weird
If $n$ is even and greater than $\textbf{20}$, print Not Weird

Input Format

A single line containing a positive integer, $n$.

Constraints

$1\leq n\leq100$

Output Format

Print Weird if the number is weird.  Otherwise, print Not Weird.

Sample Input 0
3

Sample Output 0
Weird

Explanation 0

$n=3$ 

$n$ is odd and odd numbers are weird, so print Weird.

Sample Input 1
24

Sample Output 1
Not Weird

Explanation 1

$n=24$ 

$n>20$ and $n$ is even, so it is not weird.

Difficulty: EASY

Starter code:

Solutions:
import sys
N = int(input().strip())
if N <= 100 and N >= 1:
	if N % 2 != 0:
		print('Weird')
	elif N >= 2 and N <= 5 or N > 20:
		print('Not Weird')
	else:
		print('Weird')


import sys
N = int(input().strip())
if N % 2:
	print('Weird')
elif 6 <= N <= 20:
	print('Weird')
else:
	print('Not Weird')


n = int(input())
if n % 2 != 0:
	print('Weird')
elif n % 2 == 0:
	if n > 20:
		print('Not Weird')
	elif (n >= 2) & (n <= 5):
		print('Not Weird')
	elif (n >= 6) & (n <= 20):
		print('Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N >= 6 and N <= 20 and (N % 2 == 0):
	print('Weird')
else:
	print('Not Weird')


import sys
n = int(input().strip())
if n % 2 != 0:
	print('Weird')
elif n >= 2 and n <= 5 or n > 20:
	print('Not Weird')
else:
	print('Weird')


import sys
n = int(input().strip())
if n % 2 != 0:
	print('Weird')
elif n in range(2, 5):
	print('Not Weird')
elif n in range(6, 21):
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N < 5:
	print('Not Weird')
elif N < 21:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N >= 2 and N <= 5 or N > 20:
	print('Not Weird')
elif N >= 6 and N <= 20:
	print('Weird')


import sys
N = int(input().strip())
if N % 2 == 0 and (N >= 2 and N <= 5) or (N % 2 == 0 and N > 20):
	print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if N % 2 == 1 or N in [x for x in range(6, 21)]:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird\n')
elif N % 2 == 0 and (N >= 2 and N <= 5):
	print('Not Weird\n')
elif N % 2 == 0 and (N >= 6 and N <= 20):
	print('Weird\n')
elif N % 2 == 0 and N > 20:
	print('Not Weird\n')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
elif N >= 2 and N <= 5:
	print('Not Weird')
elif N >= 6 and N <= 20:
	print('Weird')
elif N > 20:
	print('Not Weird')


import sys
n = int(input().strip())
if n & 1:
	print('Weird')
elif n >= 2 and n <= 5:
	print('Not Weird')
elif n > 5 and n <= 20:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N % 2 == 0 and (N > 2 and N < 5 or N > 20):
	print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
elif N % 2 == 0 and (N >= 6 and N <= 20):
	print('Weird')
else:
	print('Not Weird')


N = int(input())
if N % 2 != 0 or N in range(6, 21):
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 1 or N in range(6, 21):
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
n = N
w = 'Weird'
nw = 'Not Weird'
if n % 2 == 1:
	print(w)
elif n % 2 == 0 and (n >= 2 and n < 5):
	print(nw)
elif n % 2 == 0 and (n >= 6 and n <= 20):
	print(w)
elif n % 2 == 0 and n > 20:
	print(nw)


n = int(input())
if n % 2 == 1:
	print('Weird')
elif n >= 2 and n <= 5:
	print('Not Weird')
elif n >= 6 and n <= 20:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 0:
	if N in range(6, 21):
		print('Weird')
	else:
		print('Not Weird')
else:
	print('Weird')


import sys
n = int(input().strip())
if n & 1 == 1:
	print('Weird')
elif 2 <= n <= 5:
	print('Not Weird')
elif 6 <= n <= 20:
	print('Weird')
else:
	print('Not Weird')


import sys
n = int(input().strip())
if n % 2 != 0:
	print('Weird')
elif n % 2 == 0 and n in range(2, 6):
	print('Not Weird')
elif n % 2 == 0 and n in range(6, 21):
	print('Weird')
elif n % 2 == 0 and n > 20:
	print('Not Weird')


n = int(input().strip())
if n % 2 == 1:
	print('Weird')
elif 2 <= n <= 5:
	print('Not Weird')
elif 6 <= n <= 20:
	print('Weird')
elif n > 20:
	print('Not Weird')


import sys
gets = lambda : sys.stdin.readline().strip()
readInt = lambda : int(gets())
N = readInt()
print(('Not ' if not N & 1 and (not 6 <= N <= 20) else '') + 'Weird')


import sys
N = int(input().strip())
print('Weird' if N % 2 == 1 or 6 <= N <= 20 else 'Not Weird')


n = int(input().strip())
if n % 2 == 0:
	if 2 <= n <= 5:
		print('Not Weird')
	elif 6 <= n <= 20:
		print('Weird')
	else:
		print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if N % 2 != 0 and N <= 100:
	print('Weird')
if N % 2 == 0 and N >= 2 and (N <= 5):
	print('Not Weird')
if N % 2 == 0 and N > 5 and (N <= 20):
	print('Weird')
if N % 2 == 0 and N >= 21 and (N <= 100):
	print('Not Weird')


import sys
n = input()
n = int(n)
if n >= 1 and n <= 100:
	if n % 2 == 1:
		print('Weird')
	elif n % 2:
		print('Not Weird')
	elif 2 <= n <= 5:
		print('Not Weird')
	elif 6 <= n <= 20:
		print('Weird')
	elif n > 20:
		print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 0:
	if N in range(2, 5):
		print('Not Weird')
	elif N in range(6, 21):
		print('Weird')
	elif N > 20:
		print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N % 2 == 0 and 2 <= N <= 5:
	print('Not Weird')
elif N % 2 == 0 and 6 < N <= 20:
	print('Weird')
elif N % 2 == 0 and N > 20:
	print('Not Weird')


N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N in range(2, 6):
	print('Not Weird')
elif N in range(6, 21):
	print('Weird')
else:
	print('Not Weird')


n = int(input())
if (n % 2 == 0) & ((2 <= n <= 5) | (20 < n)):
	print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
odd = N % 2 != 0
print('Weird' if odd or 6 <= N <= 20 else 'Not Weird')


n = int(input())
print('Not Weird' if n % 2 == 0 and (n > 20 or n in {2, 4}) else 'Weird')


import sys
N = int(input().strip())
if N % 2:
	print('Weird')
elif 20 < N:
	print('Not Weird')
elif N <= 5:
	print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N >= 2 and N <= 5:
	print('Not Weird')
elif N >= 6 and N <= 20:
	print('Weird')
elif N > 20:
	print('Not Weird')


num = int(input().strip())
print('Not Weird' if num % 2 == 0 and (3 < num < 5 or num > 21) else 'Weird')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
elif (N > 2 or N == 2) and N < 5:
	print('Not Weird')
elif (N > 6 or N == 6) and (N < 20 or N == 20):
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
elif N % 2 == 0 and 2 <= N and (N <= 5):
	print('Not Weird')
elif N % 2 == 0 and 6 <= N and (N <= 20):
	print('Weird')
elif N % 2 == 0 and 20 < N:
	print('Not Weird')


n = int(input())
if n % 2 == 1:
	print('Weird')
elif n % 2 == 0 and n >= 2 and (n <= 5):
	print('Not Weird')
elif n % 2 == 0 and n >= 6 and (n <= 20):
	print('Weird')
elif n % 2 == 0 and n > 20:
	print('Not Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif 2 <= N <= 5:
	print('Not Weird')
elif 6 <= N <= 20:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 0:
	if N >= 6 and N <= 20:
		print('Weird')
	else:
		print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if 1 <= N <= 100:
	if N % 2 > 0:
		print('Weird')
	else:
		if 2 <= N <= 5:
			print('Not Weird')
		if 6 <= N <= 20:
			print('Weird')
		if N > 20:
			print('Not Weird')


import sys
n = int(input().strip())
if n % 2 != 0:
	print('Weird')
elif n % 2 == 0 and n >= 2 and (n <= 5):
	print('Not Weird')
elif n % 2 == 0 and n >= 6 and (n <= 20):
	print('Weird')
elif n > 20:
	print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
elif N % 2 == 0 and N >= 2 and (N <= 5):
	print('Not Weird')
elif N % 2 == 0 and N >= 6 and (N <= 20):
	print('Weird')
elif N > 20:
	print('Not Weird')


import sys
N = int(input())
if N % 2 == 0 and (N > 20 or N in range(2, 6)):
	print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if N >= 1 and N <= 100:
	if N % 2 != 0:
		print('Weird')
	elif N % 2 == 0:
		if N >= 2 and N <= 5:
			print('Not Weird')
		elif N >= 6 and N <= 20:
			print('Weird')
		elif N > 20:
			print('Not Weird')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
if N % 2 == 0 and N >= 2 and (N <= 5):
	print('Not Weird')
if N % 2 == 0 and N >= 6 and (N <= 20):
	print('Weird')
if N % 2 == 0 and N > 20:
	print('Not Weird')


i = int(input())
if i % 2 != 0:
	print('Weird')
elif i % 2 == 0:
	if i in range(2, 6):
		print('Not Weird')
	elif i in range(6, 21):
		print('Weird')
	else:
		print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N in range(6, 21):
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 0:
	if 1 < N < 6:
		print('Not Weird')
	elif 5 < N < 21:
		print('Weird')
	elif N > 20:
		print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N >= 2 and N <= 5:
	print('Not Weird')
elif N >= 6 and N <= 20:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 != 0 or (N % 2 == 0 and 6 <= N <= 20):
	print('Weird')
elif N % 2 == 0 or 2 <= N <= 5 or N >= 20:
	print('Not Weird')


n = int(input())
if n & 1 or 6 <= n <= 20:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
elif N in range(2, 5):
	print('Not Weird')
elif N in range(6, 21):
	print('Weird')
else:
	print('Not Weird')


import sys
n = int(input().strip())
if n % 2 != 0 or (n % 2 == 0 and n in range(6, 21)):
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N % 2 == 0 and N in range(2, 5):
	print('Not Weird')
elif N % 2 == 0 and N in range(6, 20) or N == 20:
	print('Weird')
elif N % 2 == 0 and N > 20:
	print('Not Weird')


n = int(input())
if n % 2 != 0:
	print('Weird')
elif n >= 2 and n <= 5 or n > 20:
	print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
elif N >= 2 and N <= 5:
	print('Not Weird')
elif N >= 6 and N <= 20:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N % 2 == 0 and N >= 2 and (N <= 4):
	print('Not Weird')
elif N % 2 == 0 and N >= 6 and (N <= 20):
	print('Weird')
elif N % 2 == 0 and N > 20:
	print('Not Weird')


import sys
num = int(input().strip())
if num % 2 != 0 or 6 <= num <= 20:
	print('Weird')
else:
	print('Not Weird')


import sys
n = int(input().strip())
if n % 2 == 1 or 6 <= n <= 20:
	print('Weird')
else:
	print('Not Weird')


import sys
n = int(input())
if n % 2 != 0 or (n >= 6 and n <= 20):
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N > 1 and N < 6:
	print('Not Weird')
elif N > 5 and N < 21:
	print('Weird')
elif N > 20:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 0:
	if N >= 2 and N <= 5:
		print('Not Weird')
	elif N >= 6 and N <= 20:
		print('Weird')
	else:
		print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if N % 2 == 1 or (N >= 6 and N <= 20):
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
print('Weird' if N % 2 != 0 or 6 <= N <= 20 else 'Not Weird')


import sys
N = int(input().strip())
ans = 'Weird'
if N % 2 == 0:
	if N <= 5 or 20 < N:
		ans = 'Not Weird'
print(ans)


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
elif N % 2 == 0 and 2 < N < 5:
	print('Not Weird')
elif N % 2 == 0 and 6 < N <= 20:
	print('Weird')
elif N % 2 == 0 and N > 20:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
elif N >= 6 and N <= 20:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
elif N > 5 and N < 21:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 0:
	if N > 20:
		print('Not Weird')
	elif N > 5 & N < 21:
		print('Weird')
	elif N > 1 & N < 6:
		print('Not Weird')
else:
	print('Weird')


val = int(input(''))
flag = 0
if val % 2 != 0:
	flag = 1
elif val % 2 == 0 and (val >= 2 and val <= 5):
	flag = 0
elif val % 2 == 0 and (val >= 6 and val <= 20):
	flag = 1
elif val % 2 == 0 and val < 20:
	flag = 0
if flag == 1:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif 6 <= N <= 20 and N % 2 == 0:
	print('Weird')
else:
	print('Not Weird')


import sys
n = int(input().strip())
if n % 2 != 0:
	print('Weird')
elif n >= 2 and n <= 5:
	print('Not Weird')
elif n <= 20:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 0 and (N > 20 or N in range(2, 6)):
	print('Not Weird')
else:
	print('Weird')


N = int(input().strip())
if N % 2:
	print('Weird')
elif N >= 2 and N <= 5:
	print('Not Weird')
elif N >= 6 and N <= 20:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
elif N >= 2 and N <= 5:
	print('Not Weird')
elif N >= 6 and N <= 20:
	print('Weird')
elif N >= 20:
	print('Not Weird')


n = int(input())
if n % 2 == 1:
	print('Weird')
elif n in range(2, 6):
	print('Not Weird')
elif n in range(6, 21):
	print('Weird')
else:
	print('Not Weird')


n = int(input())
if n % 2 == 1:
	print('Weird')
elif n % 2 == 0 and n >= 2 and (n <= 5):
	print('Not Weird')
elif n % 2 == 0 and n >= 6 and (n <= 20):
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N > 20:
	print('Not Weird')
elif N > 5:
	print('Weird')
else:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 0 and (N >= 2 and N <= 5 or N > 20):
	print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if N % 2:
	print('Weird')
elif not N % 2 and N >= 2 and (N <= 5):
	print('Not Weird')
elif not N % 2 and N >= 6 and (N <= 20):
	print('Weird')
elif not N % 2 and N > 20:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 1:
	print('Weird')
elif N % 2 == 0 and N >= 2 and (N <= 5):
	print('Not Weird')
elif N % 2 == 0 and N >= 6 and (N <= 20):
	print('Weird')
elif N % 2 == 0 and N > 20:
	print('Not Weird')


n = int(input())
if n % 2 == 0 and (n > 20 or (n in range(2, 5) and (not n in range(6, 20)))):
	print('Not Weird')
else:
	print('Weird')


import sys
n = int(input().strip())
a = 'Weird'
b = 'Not Weird'
if n % 2 == 1:
	print(a)
elif n % 2 == 0 and 2 <= n <= 5:
	print(b)
elif n % 2 == 0 and 6 <= n <= 20:
	print(a)
elif n % 2 == 0 and n > 20:
	print(b)


def __starting_point():
	n = int(input())
	if n % 2 == 1 or 6 <= n <= 20:
		print('Weird')
	else:
		print('Not Weird')
__starting_point()


x = int(input())
if x % 2 != 0:
	print('Weird')
elif x % 2 == 0:
	if x >= 2 and x <= 5:
		print('Not Weird')
	if x >= 6 and x <= 20:
		print('Weird')
	if x > 20:
		print('Not Weird')


import sys
N = int(input().strip())
if N % 2 == 0:
	if 2 <= N <= 5:
		print('Not Weird')
	elif 6 <= N <= 20:
		print('Weird')
	elif N > 20:
		print('Not Weird')
else:
	print('Weird')


import sys
N = int(input().strip())
if N % 2 == 1 or (N >= 6 and N <= 20):
	print('Weird')
elif N >= 2 and N <= 5 or N >= 20:
	print('Not Weird')


import sys
N = int(input().strip())
if N % 2 != 0:
	print('Weird')
elif 2 <= N <= 5:
	print('Not Weird')
elif 6 <= N <= 20:
	print('Weird')
else:
	print('Not Weird')


n = int(input().strip())
if n % 2 == 1:
	print('Weird')
elif n >= 2 and n <= 5 or n > 20:
	print('Not Weird')
else:
	print('Weird')