我正在为一个学校项目编写这段代码,它是这样的:
valid_entries = ['y', 'n', 'hatchback', 'estate', 'saloon']
model_options = {
'Hatchback' : 535000,
'Saloon' : 495000,
'Estate' : 625000
}
total_price = 0
model_chosen = input("Which car model do you want to buy?\n> ")
while model_chosen not in valid_entries:
print("Invalid Input\nTry again")
model_chosen = input("Which car model do you want to buy?\n> ")
有没有办法可以访问这些值并将其与输入进行比较并将其添加到分数中?
ITMISS
慕桂英546537
相关分类