dimanche 9 mai 2021

How can i get my code to work correctly? user input is not working with if, elif, and else

if, elif, and else are not working with my inputs correctly. I am trying to make it so you have to pass all three questions to gain access to my fake club. but the problem is if you answer the first two questions incorrectly and the third one correctly, you still gain access to the club. also, this is an assignment for school, and my teacher said i was missing a heading, and my if statements contained no logical statements to actually weed out or accept potential users. please, help.

def main():
    age = input("are you younger than 21?")
    game = input("what is the game of the day?")
    cool = input("what do you think about school?") 
    
    print("Welcome to Kidz Only.")
    print("are you cool enough to enter?")
    
    if( age == "yes"):
        print("question one is done.")
    if ( game == "super mario bros"):
        print("question two is through.")    
    if ( cool == "i have mixed feelings"):
        print("question three is complete.")
        print("You have passed the quiz. Welcome to Kidz Only!")
        
    else:
        print("Sorry, but you may not enter Kidz Only.")
        
main()

Aucun commentaire:

Enregistrer un commentaire