#!/usr/bin/python # Simple while loop a = 0 while a < 15: print a, # 在print a后面加,不换行 if a == 10: print "made it to ten!!" a = a + 1
运行结果如下:
0 1 2 3 4 5 6 7 8 9 10 made it to ten!!
11 12 13 14
以上就是python中while循环的使用方法的详细内容,更多请关注Gxl网其它相关文章!
查看更多关于python中while循环的使用方法的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did84572