我想检查我的选项字符串和选项字符串int是否都等于值D和D。请不要将它们都配对。
if option + option_2 == "D" and "D":
rate = r()
time = t()
distance = velocity * time
print (f"The distance traveled is {distance} meters")
exit()`
答案 0 :(得分:1)
您可以改用以下条件:
if option == option_2 == "D":