Learn Python the Hard Way: while循环
生活随笔
收集整理的這篇文章主要介紹了
Learn Python the Hard Way: while循环
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
【語法格式】
while (表達式):
? ? ...
else:
? ? ...
【示例】
#!/usr/bin/python #?-*-?coding:?utf-8?-*-i?=?0 numbers?=?[] while?i?<?6:print?"At?the?top?i?is?%d"?%?inumbers.append(i)i?=?i?+?1print?"Numbers?now:?",?numbersprint?"At?the?bottom?i?is?%d\n"?%?iprint?"The?numbers:?" for?num?in?numbers:print?num轉載于:https://my.oschina.net/goopand/blog/380745
總結
以上是生活随笔為你收集整理的Learn Python the Hard Way: while循环的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: TypeError: decoding
- 下一篇: 国外期刊