为了账号安全,请及时绑定邮箱和手机立即绑定

如何将下边这段while改写?用Python。

如何将下边这段while改写?用Python。

毛毛雨林527 2016-11-23 03:53:22
i = 0numbers = []while i < 6:    print "At the top i is %d" % i    numbers.append(i)    i = i + 1    print "Number now: ", numbers    print "At the bottom i is %d" % iprint "The numbers: "for num in numbers:    print num如何将上边这段while代码改写成一个函数,将测试条件(i<10)中的10 换成一个变量。用for loop和range重写一遍。
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 1322 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号