Ask coding questions

← Back to all posts
If statement returning incorrectly
MarquzMule (0)

I'm new to python and I know this code is not optimized but I encourage suggestions on how to do so. However, the problem is that when the user is asked to restart, the code will do so regardless of what input is entered. I believe it has something to with my use of the or operator because the code worked fine when the if statement only checked for "yes" and nothing else.

mwilki7 (653)

Have you fixed it in the mean time? It seems to be running okay when I put in Y or N.

OmegaBlaziken (1)

@MarquzMule It works for me as well, and the logic looks good too... I don't see any problem with the code or the results.