tires = float(input('How many tires would you like?'))
if tires == 2:
print('That will be $250')
if tires == 4:
print('That will be $400')
else:
print('That is not a valid input, please try again')
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
将整个内容包装成
while
循环:相关问题 更多 >
编程相关推荐