import random
print(’--------今天中午吃什么--------’)
print(‘~\n’)今日菜单
def eat():
a=[‘红烧牛肉盖饭’,‘蛋炒饭’,‘食堂’,‘砂锅饭’,‘铁板牛柳炒饭’,‘烧烤炒饭’,
‘曹氏鸭脖’,‘盖浇饭’,‘猪脚饭’,‘砂锅冒菜’,‘锅巴土豆’,‘狼牙土豆+凉面’,‘火锅粉’,
‘螺蛳粉’, ‘酸辣粉’,‘泡面’,‘过桥米线’,‘肥肠粉’]
print(a)
while True:
b=random.choice(a)
c.append(b)
print('中午吃%s吧'%b)
ask=input('满意按1,不满意按2:')
if ask=='1':
print('好的,今天在中午就吃%s!'%b)
break
c=input('对点菜系统满意吗?如要添加菜品请输入y,输入其他退出系统:')
if c=='y':
d=input('你想添加什么菜品?')
a.append(d)
print('菜品添加成功')
print(a)
else:
print('那我们下次再见啦')
eat()
在这个项目中,如何让出现过一次的菜品,下次随机生成时不再出现?