python

zhangshen12356 2019-09-24 02:22:14
sandwich_orders=['xigua','putao','ixangjiao','juzi'] finished_sandwiches=[] for sandwich_order in sandwich_orders: print(sandwich_order) print('i made your '+sandwich_order+' sandwich') while sandwich_orders: current_sandwich=sandwich_orders.pop() finished_sandwiches.append(current_sandwich) for finished_sandwich in finished_sandwiches: print('\n'+finished_sandwich)请问一下要是我没有最后面的那个while sandwich_orders要是不写的话为什么下面的那一块程序不运行,我感觉python运行完前面的会接着运行下面的呀。是个新手。不是很懂,
...全文
137 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

2,089

社区成员

发帖
与我相关
我的任务
社区描述
在线培训学习经验交流分享、优质课程资源共享。
社区管理员
  • IT课程大本营社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧