• + 142 comments

    Fairly straightforward even without using if-else statements:

    n = int(input().strip())
    check = {True: "Not Weird", False: "Weird"}
    
    print(check[
            n%2==0 and (
                n in range(2,6) or 
                n > 20)
        ])
    

    I defined a simple dictionary. If the value it gets is true, the program prints "Not Weird", and if it's false "Weird" is printed. Then I simply created a bunch of statements that evaluate to either True or False.

    Sure, one could argue that this is against the rules because the task was all about if-else statements, but I wanted to see if an alternative solution was better.

    EDIT: Replaced the list comprehension with a simple boolean expression