I am writing a basic program in python to guess a favorite food. I made a variable answer
with two options of "pizza" or "Pizza"
because they're going to be input from a user and I don't want capitalized words to give a false negative when guessing.
However when i test the program and type the 2nd option "Pizza"
it does result in an incorrect guess. The very thing i was trying to prevent. I cant figure out why.
answer = "pizza" or "Pizza"
guess = input("What's my favorite food? ")
counter = 1
while (guess != answer):
counter += 1
if guess == answer:
print("Yep! So amazing!")
else:
print("Yuck! That’s not it!")
guess = input("Try again. ")
print("Correct!")
print("Thanks for playing! It took you " + str(counter) + " guesses.")
side question: I think my while
loop is written incorrectly for a correct guess... while it works as intended if i type "pizza"
this piece of code here :
if guess == answer:
print("Yep! So amazing!")
doesnt seem to do anything. but its also not messing anything up.