Skip to content

Commit

Permalink
Merge pull request #4 from Petsamuel/main
Browse files Browse the repository at this point in the history
 resolve #1
  • Loading branch information
iamdestinychild authored Oct 2, 2023
2 parents c417582 + 87db549 commit 0f2d619
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions LeetCode/IF-else-hackerRank/PROBLEM.md
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.
20 changes: 20 additions & 0 deletions LeetCode/IF-else-hackerRank/python/python.py
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")

0 comments on commit 0f2d619

Please sign in to comment.