此脚本没有通过第一个if表达式! 如果用户输入DD或F,则脚本的行为类似于If状态为true。你知道吗
choice = raw_input("Cup size for bra: D, DD, or F: ")
if choice == "D" or "d":
band_length = raw_input("Please enter the bra band length for your D size breasts: ")
D_Statistics(band_length)
elif choice == "DD" or "dd":
band_length = raw_input("Please enter the bra band length for your DD size breasts: ")
DD_statistics(band_length)
elif choice == "F" or "f":
band_length = raw_input("Please enter the bra band length for your F size breasts: ")
F_statistics(band_length)
您的
if
语句当前的计算结果总是True
。你知道吗if choice == "D" or "d"
在choice
的值等于“D”或文字“D”的值为真时求值为真;因此第二部分总是True
。你知道吗相反,使用
相关问题 更多 >
编程相关推荐