Sort by

recency

|

4511 Discussions

|

  • + 0 comments
    if n%2!=0:
        print("Weird")
    else:
        if 2<=n<=5:
            print("Not Weird")
        elif 6<=n<=20:
            print("Weird")
        else:
            print("Not Weird")
            
    
  • + 0 comments

    Why it Wrong?? x = int(input()) if x % 2 == 1: print('Weird') else: if x in range(2,5): print('Not Weird') elif x in range(6,20): print("Weird") else: print('Not Weird')

  • + 0 comments

    n = int(input())

    if n%2==1 or n>=6 and n<=20: print("Weird") else: print("Not Weird")

        More of a short way to write it by using operators
    
  • + 0 comments

    n = 30 if not n % 2 == 0: print("Weird") elif n % 2 == 0 and 2 <= n <= 5: print("Not Weird") elif n % 2 == 0 and 6 <= n <= 20: print("Weird") elif n % 2 == 0 and 20 < n: print("Not Weird") Why does the website show false?

  • + 0 comments

    if name == 'main': n = int(input().strip()) if n%2!=0: print("Weird") elif n%2==0 and range(2,6): print("Not Weird") elif n%2==0 and range(6,21): print("Weird") elif n%2==0 and n>20: print("Not Weird")