Thursday, December 12, 2019

christmas whishes game

christmas_wishes = ["bicycle","teddy bear", "ball"]
scrambled_words = ["cylebi","rabe yddet","lbal"]

def play():
    for position, word in enumerate(scrambled_words):
        guess = input("Guess what is this scrambled word: "+ word)
       
        if position == 0:
            if guess == christmas_wishes[0]:
                print("Correct answer: ", guess)
            else:
                print("Sorry you were wrong")
        elif position == 1:
            if guess == christmas_wishes[1]:
                 print("Correct answer: ", guess)
            else:
                 print("Sorry you were wrong")
        else:
            if guess == christmas_wishes[2]:
                 print("Correct answer: ", guess)
            else:
                 print("Sorry you were wrong")
                     
                     
                     
                     
play()

No comments:

Post a Comment