Sort by

recency

|

4460 Discussions

|

  • + 0 comments

    n = 7 if n % 2==1: print ("weired") elif n % 2 == 0 and 2 <= n <=5: print ("not weired")
    elif n % 2 == 0 and 6 <= n <=20: print ("weired") elif n % 2 == 0 and n > 20: print ("not weired") whats wrong with this code

  • + 0 comments

    Check out my code:

    if name == 'main': n = int(input().strip()) o_e = n%2 if( not o_e and (2<=n<=5 or n>20)): print("Not Weird") elif( o_e or ( not o_e and 6<=n<=20)): print("Weird")

  • + 0 comments

    n = int(input('Enter the number: '))

    if n % 2 != 0: print('Weird')

    elif 2 <= n <= 5 : print('not Weird')

    elif 6 <= n <= 20: print('Weird')

    else: print('NOT Weird')

  • + 0 comments

    n = int(input("Enter the number: "))

    if n % 2 != 0: print("Weird") elif 2 <= n <= 5: print("Not Weird") elif 6 <= n <= 20: print("Weirdn = int(input("enter the number:")) if n % 2 == 0: if n in range(2,6): print("Not Weird"); elif n in range(6,21): print("Weird"); elif n > 20: print("Not Weird"); whats wrong on my code .

    else: print("Weird") else: print("Not Weird")

  • + 0 comments
    n = int(input().strip())
    
    
    if(n % 2==0 ):
        if 2< n < 5 or n> 20:
            print('Not Weird')
        elif(6<n<=20):
            print('Weird')
    
    else:
        print('Weird')