Skip to main content

Posts

Showing posts with the label Python If-Else Hackerrank Solution

Python If-Else Hackerrank Solution

 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  math import  os import  random import  re import  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' )