Python If-Else Hackerrank Solution
For Explanation Watch Video:
Sample Input 0
3
Sample Output 0
Weird
Sample Input 1
24
Sample Output 1
Not Weird
Code:
#!/bin/python3
import mathimport osimport randomimport reimport sys
if __name__ == '__main__': 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')
Comments
Post a Comment