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