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.
- Prepare
- Python
- Introduction
- Python If-Else
- Discussions
Python If-Else
Python If-Else
Sort by
recency
|
4515 Discussions
|
Please Login in order to post a comment
if name == 'main': n = int(input().strip()) if n % 2 != 0: print("Weird") elif n in range(2,5) and n % 2 == 0: print("Not Weird") elif n in range(6,21) and n % 2 == 0: print("Weird") elif n in range(20,101) and n % 2 == 0: print("Not Weird") else: print("end") else: ("end")
if name == 'main': n = int(input().strip()) if n % 2 != 0 : print("Weird") elif n % 2 == 0 : for i in range(2,5): print("Not Weird") elif n % 2 == 0 : for g in range(6,20): print("Weird") elif n % 2 == 0 and n >20 : print("Not Weird")000
print("Weird" if n % 2 != 0 or (6 <= n <= 20) else "Not Weird")