猫史档案馆


【Python作品分享】新的作品【作业帖】

用户:内向的月见草2N2D内向的月见草2N2D查看:0 回复:0 评论:0 创建时间:2022-06-16T17:24:42


【作品展示】

center_image

 

【作品介绍】

作业

 

【作品源代码】

food_list1 = ['奶茶', '螺蛳粉', '炸鸡', '臭豆腐']
food_list2 = ['鸡排', '臭豆腐', '宫保鸡丁', '猪蹄']
food_list3 = ['臭豆腐', '梅干菜扣肉饼', '脆皮五花肉', '杨枝甘露']
food_list4 = ['杨枝甘露', '螺蛳粉', '臭豆腐', '榴莲']
food = input('请输入你喜欢的食物:')
if food in food_list1 and food in food_list2 and food in food_list3 and food in food_list4:
    print('太好了,我们达成一致,我们一起吃{}吧'.format(food))
    print('我们只有一个达成,请重新再选择吧')
while True:
    food = input('请输入你喜欢的食物:')
    if food in food_list1 and food in food_list2 and food in food_list3 and food in food_list4:
        print('太好了,我们达成一致,我们一起吃{}吧'.format(food))
    else:
        print('我们不一致,请重新选择')
    break

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页