one_more_input = "yes"
user_select = one_more_input.lower()
if(user_select is "yes" or user_select is "y"):
result = True
else:
result = False
print(result)
We are creating a function that returns True if "Y" or "YES" regardless of case, but we want to make the output value true, but we keep printing False. How do I do this?
python string
one_more_input ="yes"
user_select = one_more_input.lower() #
if(user_select == "yes" or user_select == "y"):
result = True
else:
result = False
print(result)
Change the identification operator is
to the relational operator ==
.
© 2024 OneMinuteCode. All rights reserved.