题解 | #食堂点餐#
食堂点餐
http://www.nowcoder.com/practice/24a68a70621a4803845304be3304ac5f
order_list = ['rice', 'beef', 'chips', 'pizza', 'pizza', 'yogurt', 'tomato', 'rice', 'beef']
sum = 0
for i in order_list:
if i == 'pizza':
sum += 10
print(f'{i} is 10 dollars')
elif i == 'rice':
sum += 2
print(f'{i} is 2 dollars')
elif i == 'yogurt':
sum += 5
print(f'{i} is 5 dollars')
else:
sum+=8
print(f'{i} is 8 dollars')
print(sum)