r/learningpython • u/Major-Language-2787 • Jan 18 '26
Confused about why code A doesn't work
This is in a while loop called is_bidding
Code A:
resume = input("Is there another bidder? Type 'yes' or 'no': \n").lower()
print(resume)
if resume != 'no' or 'yes:
print('We will take that as a no')
is_bidding = False
elif resume == 'yes':
print("Let us resume.")
else:
print("Very well let's see whose won...")
is_bidding = False
intentions: I wanted the if statement to check if the user did NOT enter 'yes' or 'no'
results: When typing 'yes', the first condition runs, and I am not sure why
Edit: Thanks for the feedback, I understand what I did wrong.
2
Upvotes
View all comments
1
u/Outside_Complaint755 Jan 19 '26 edited Jan 19 '26
As others have said, instead of
You need to do (edited)
or