+ 1
if statement problem ... Help !
it's a simple login script requires multiple input so you might need to try it on your local terminal (if there's a way to compile it on the website please let me know) the main problem is with the if statement "you'll find a comment over it" the program enters the if statement even when the condition is false ???? i'm new to python https://code.sololearn.com/cG9ha058nNHY
2 Answers
+ 6
What i found is an issue in the RegToBool() function:
def RegToBool(Answer):
if Answer == "Y" or "y": # should be: if Answer == "Y" or Answer == "y"
print(f'regtobool {Answer}')
return True
elif Answer == "N" or "n": # should be: elif Answer == "N" or Answer == "n":
# or better do something like this:
if Answer.lower() == "y":
elif Answer.lower() == "n":
+ 1
Lothar this was really helpful, thanks alot man đ