Code is not passing through

print("Welcome to my house!")

play = input("Want to play a game? ")
##no
# print(play)
if play.lower != "yes":
    quit()
   ## print("Quitting game")
print("Great! Let's play")
score = 0

answer = input("What is the color of the sky? ")
if answer.lower() == "blue":
    print("Correct!")
    score += 1
else:
    print("Incorrect!") 

answer = input("What are the colors of the sun? ")
if answer.lower() == "orange, red, yellow":
    print("Correct!")
    score += 1
else:
    print("Incorrect!") 

answer = input("What is the color of the grass? ")
if answer.lower() == "green":
    print("Correct!")
    score += 1
else:
    print("Incorrect!") 

answer = input("What is the color of Hover dam? ")
if answer.lower() == "gray":
    print("Correct!")
    score += 1
else:
    print("Incorrect!") 

answer = input("What is the color of the Xbox 360? ")
if answer.lower() == "black":
    print("Correct!")
    score += 1
else:
    print("Incorrect!") 


print("Your scored " + score + "points")

if score < 3 :
    print("Try again next time.")
else: 
    print("Congrats! You passed.") 

I get stuck when i enter no nothing happens which is good, but when i enter yes still nothing happens? Its not in the curriculum but trying to get this to work any suggestions?

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

lower is function
so call it like this
play.lower()

Thank you so much got it to work now

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.