-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Petsamuel/main
resolve #1
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Task | ||
Given an integer, n, perform the following conditional actions: | ||
|
||
TASK | ||
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 6 to 20, print Weird | ||
If n is even and greater than 20, print Not Weird | ||
Input Format | ||
|
||
A single line containing a positive integer, n . | ||
|
||
|
||
Output Format | ||
|
||
Print Weird if the number is weird. Otherwise, print Not Weird. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/python3 | ||
|
||
import math | ||
import os | ||
import random | ||
import re | ||
import sys | ||
|
||
if __name__ == '__main__': | ||
n = int(input().strip()) | ||
if ( (n%2) != 0): | ||
print("Weird") | ||
elif (n in range (2, 5, 2)): | ||
print ("Not Weird") | ||
elif (n in range(6,20,2 )): | ||
print ("Weird") | ||
elif (n > 20): | ||
print ("Not Weird") | ||
else: | ||
print("Weird") |