我很好奇,如何使该程序在触发else语句后自动提示用户另一个值。
.col.l2.custom, .col.m1.custom {
min-height: 100vh; /* use "vh" instead of % */
}
答案 0 :(得分:4)
将整个内容包装在while
循环中:
while True:
tires = float(input('How many tires would you like?'))
if tires == 2:
print('That will be $250')
break
elif tires == 4:
print('That will be $400')
break
else:
print('That is not a valid input, please try again')
# keep looping