Python Python Basics All Together Now Branch and Loop

Cant decrement my "There are 100 tickets remaining"

The code is in the link

3 Answers

Brandon Spangler
Brandon Spangler
8,751 Points

Will line 17 ever evaluate to true?

line 17: if user.lower() == "Y" Shouldn't that Y be y since you're converting their input to lowercase?

Steven Parker
Steven Parker
182,307 Points

On line 17:

    if user.lower() == "Y":

This converts what the user typed into lower case and then compares it with "Y". Since there is nothing that when converted to lower case would match a capital "Y", this test will always fail.

You can fix it by using an "upper" conversion instead, or just matching with a lower case "y".

Thank you Brandon Spangler & Steve Parker