How to check two things in user input
How to check two things in user input
I would like to check if my option string and my option string int are equal to BOTH values D and D. Does not pair with them both.
if option + option_2 == "D" and "D":
rate = r()
time = t()
distance = velocity * time
print (f"The distance traveled is distance meters")
exit()`
1 Answer
1
You can use the following condition instead:
if option == option_2 == "D":
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.