[[DA series - Learn Python with Steem]](https://steemit.com/da-learnpythonwithsteem/@deanliu/da-series-learn-python-with-steem-00-coding) 是DA(@deanliu & @antonsteemit)關於「從Python程式語言實做Steem區塊鏈的入門」的系列,歡迎趕緊入列學習! 前情提要:[[DA series - Learn Python with Steem #03] 邏輯判斷](https://steemit.com/da-learnpythonwithsteem/@deanliu/da-series-learn-python-with-steem-03) https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmbeN1PpqQC2JE5HbpXatb3apUfFhe68fPLctT95FiiRHq/cover.png 第#04堂課,今天我們來學習另一個也是非常重要的主題:**迴圈** 。 ## Python的迴圈 (Loop) 前一期說完了if-else判斷式,這一期來看看另一個重要的元素:迴圈。 迴圈簡單的說,就是讓電腦「重複執行某一動作」的語法。原因很簡單,我們使用電腦程式就是為了解決繁瑣的工作內容,而這種重複性很高的動作,我們可以透過迴圈的設定讓我們一個程式就執行完所有內容。舉個簡單的例子,若是我們未來要觀察區塊鏈上的內容,可以透過迴圈的方式不斷搜尋不同的block,不斷的回去翻找歷史直到第一個區塊為止。 迴圈又可以分為**While迴圈**跟**For迴圈**,其中只是是語法跟使用情境稍有不同,大部分的概念是一樣的。我們先來介紹While迴圈。 ### While Loop `While`迴圈的使用情境是「面對我們不知道何時會中止的程式時」。可以用以下一個簡單的例子讓大家稍微看一下這個邏輯: 註:本篇教學的程式碼可以到[GitHub](https://github.com/antoncoding/Python-x-Steem-tutorial/blob/master/tutorial_4.py)觀看。  執行結果: ``` Stop! 2097152 ``` While的執行邏輯是:每次執行while的範圍內的程式前,會先確認`while`後面的expression是否為True。如果是True的話就會執行內容,反之則跳過迴圈。這裡我們先使用一個布林變數`continue_to_loop = True`來當作「要不要繼續迴圈的指標」,稍後我們只要改變這個變數,迴圈就會中止。 跟`if-else`相同的是,被包含在`while`迴圈裡面要做的事情,我們一樣要使用縮排一層一層的包好,免得讓系統誤會。這裡我們一開始令 n = 1,在每次迴圈裡都把他乘以二,並且判斷這個新的n有沒有大於1312300。如果有的話,我們就把**`continue_to_loop`這個變數設為False**,藉此中止程式。 所以等程式不知道經過多少次迴圈後,2的某個次方數變成2097152,也就大於一開始設定的`m`了,迴圈因此中止,並且最後印出`n`:這時已經是 2097152。 這種先設計一個**布林變數**來看要不要停止迴圈的手法,通常這個變數會被稱為`flag`,因為它的True or False決定了迴圈的命運。這種手法在很多情況下很好用,也會讓程式的運作邏輯很淺顯易懂。不過其實我們這一個例題是不需要用到Flag的,如果只是單純的數字比較的話,我們可以做一些簡化:  這樣是不是簡單很多呢?我們將我們希望每個迴圈繼續執行的條件:`n < m `放在while的後面,而while迴圈的設計正好就是「不斷執行直到不滿足 `n < m`」,也就是在`n >= m`時就會自動停止了。 ## For Loop 另一個迴圈是`for`迴圈,原本在程式語言中通常是用來執行「可以預期什麼時候結束的迴圈」。跟while loop不同的地方在於,我們一開始就會告訴程式我們要loop的範圍或是次數。舉一個最最簡單的例子,就是印出1~15的數字:  執行結果: ``` 0 1 2 ... 14 ``` 在 for 的語法 公式就是 `for x in o:`,代表著:「走過`o`裡面所有的`x`」。上面的這段程式有一個新的部份叫做`range()`,專門用來產生這種一串的東西讓for迴圈走過。所以`range(15)`就會產生0,1,2,3,4,....,14 (從0開始直到大於等於15停止)(在預設情況下,只輸入一個數字n就是從零開始走到n,不含n)。如果我們想要指定從1開始走走到15,就可以寫成range(1,16)。 不過python好用的地方在於,我們往往不需要知道一個「O」裡面有多少個「x」,就可以直接很懶的使用`for`迴圈了。python的for迴圈很聰明,會自動幫我們想像「我們應該是要重複拿出裡面的某些東西」。 例如下列程式中,我們先把東西存在一個**陣列(array)**(後面我們會教更多關於陣列等等**資料結構**)裡面,然後就可以透過for迴圈「一個一個讀出來」。  執行結果: ``` apple is in your shopping list orange is in your shopping list lemon is in your shopping list Xiaomi 6 Plus is in your shopping list iPhoneX is in your shopping list ``` 這段程式當中,我們先把`shopping_list`定義好,把一堆的**字串**存在這個陣列裡。接著我們利用`for item in shopping_list`的語法,來走遍每一個item。 `python`聰明的地方是,我們可以直接叫for loop跑完整個清單,每次回傳一個東西,**並且這個回傳的東西叫做item**。我們前面完全沒有告訴過python說過item是什麼,這一句 `for item in shopping_list`就好像:「遍歷`shopping_list`裡面的東西,每次拿出一個,稱為item」。所以在這個迴圈中,第一次 item = `apple`,第二次 item = `orange` ,以此類推。 不過這裡的`print()`裡面我們多了一個函式,稱為`format()`,是今天要教大家第二個好用的小技巧。format()是**字串的一個class method (類別函式)**,也就是只有字串能夠用。我們可以用這樣的語法**在字串中加入我們要的變數**: ``` 'The value of variable a is {}'.format(a) ``` 意思就是把a的值,以字串的形式放入前面那一串子裡面的`{}`中。 所以上一段例子裡,每次我們會印出 ' {} is in your shopping list ',其中{}就會變成每次的item,也就是物品名子。這樣是不是在設計output的時候有比較方便阿! ## Homework time:練習題! 好了,今天簡單的for, while介紹就到此為止了,也來給大家出一個練習題,同時也是程式設計裡面的經典:**九九乘法表**。**問題:請用迴圈在螢幕上列出99乘法表**。提示:要使用雙重迴圈,也就是Loop in a Loop。  不過要完成這個作業,大家可能還需要一點新技能,就是關於`print()`函數的多一點認識。print()在沒有任何設定的情況下,會印出你輸入的內容**並且換行**。在印九九乘法表的時候,我們並不是每次印出數字就要換行,因此會需要使用print 函數裡面的`end`設定來變更這個預設的**字莫換行 print(number, end = ' '),會在螢幕上印出number的值,並且不換行,而是在後面加上`' '`。 如果想要印出**縮排**,也就是一個整齊的空格的話,可以設定`end = '\t'`,如下: ``` print(number, end = '\t') ``` (在程式語法裡,通常使用`\t`來表示縮排(tab),而用`\n`表示換行) 接著就祝大家好運了,我們下回見~ 寫完的朋友們,也歡迎來[GitHub@antoncoding](https://github.com/antoncoding/Python-x-Steem-tutorial/blob/master/tutorial_4_exercise.py)對對答案呀!不過這不是唯一的解法喔~ 我們下篇文章再見囉~下課!  <sub>*image - pixabay*</sub>
author | deanliu |
---|---|
permlink | da-series-learn-python-with-steem-04 |
category | da-learnpythonwithsteem |
json_metadata | {"tags":["da-learnpythonwithsteem","python","steem","cn-programming","cn"],"users":["deanliu","antonsteemit"],"image":["https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmbeN1PpqQC2JE5HbpXatb3apUfFhe68fPLctT95FiiRHq/cover.png","https://cdn.steemitimages.com/DQmSgwvcDv7gcBkE8v3cwgv1xbf6iX2Ux6uzApt1Zgc6HVi/image.png","https://cdn.steemitimages.com/DQmYdWaiDnkv9DqoCHmFh423WwuqkuzywBzXmmLzKdMPgwQ/image.png","https://cdn.steemitimages.com/DQmcaLW9kBcbri1eVC2HDkswvzrFWHZtG8pFh85cUGXJE99/image.png","https://cdn.steemitimages.com/DQmd7A8beBs7pLFZByfs21JRrwtDyV3BKj8R55dDBfz8f9w/image.png","https://cdn.steemitimages.com/DQmaLo9WaZyuAHaWnDNGowdhYJhGrie8M9KuHMSYFmHijya/image.png","https://cdn.steemitimages.com/DQmbTcEoAB7HRTxy11a1eDN8vREiGqxEMd7P3jJ3TGvGSTv/class-377117_1280.jpg"],"links":["https://steemit.com/da-learnpythonwithsteem/@deanliu/da-series-learn-python-with-steem-00-coding","https://steemit.com/da-learnpythonwithsteem/@deanliu/da-series-learn-python-with-steem-03","https://github.com/antoncoding/Python-x-Steem-tutorial/blob/master/tutorial_4.py","https://github.com/antoncoding/Python-x-Steem-tutorial/blob/master/tutorial_4_exercise.py"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-07-31 02:21:06 |
last_update | 2018-08-01 14:29:33 |
depth | 0 |
children | 17 |
last_payout | 2018-08-07 02:21:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 26.237 HBD |
curator_payout_value | 4.407 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 4,330 |
author_reputation | 3,091,923,678,819,098 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,583,113 |
net_rshares | 17,955,569,472,890 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
abit | 0 | 322,174,997,236 | 100% | ||
adm | 0 | 5,418,148,813,546 | 30% | ||
jademont | 0 | 30,176,487,235 | 10% | ||
coinbitgold | 0 | 54,749,667,163 | 80% | ||
wongshiying | 0 | 141,756,816 | 100% | ||
mark-waser | 0 | 26,376,073,070 | 25% | ||
blockchainbilly | 0 | 20,097,909,372 | 50% | ||
deanliu | 0 | 1,428,010,520,576 | 100% | ||
joythewanderer | 0 | 181,712,921,741 | 50% | ||
daynewright | 0 | 16,432,967,399 | 65% | ||
team-leibniz | 0 | 51,718,508,824 | 40% | ||
ace108 | 0 | 285,408,003,227 | 25% | ||
laoyao | 0 | 34,990,307,911 | 100% | ||
somebody | 0 | 1,297,012,593,945 | 100% | ||
midnightoil | 0 | 124,792,679,585 | 100% | ||
xiaohui | 0 | 704,813,332,560 | 100% | ||
oflyhigh | 0 | 2,422,167,962,862 | 100% | ||
xiaokongcom | 0 | 239,252,315 | 100% | ||
yulan | 0 | 14,686,863,709 | 100% | ||
rivalhw | 0 | 1,878,219,508,456 | 100% | ||
chinadaily | 0 | 202,730,562,828 | 100% | ||
helene | 0 | 776,632,136,310 | 100% | ||
ethansteem | 0 | 181,740,378,866 | 100% | ||
davidjkelley | 0 | 1,320,975,754 | 25% | ||
digital-wisdom | 0 | 14,490,274,565 | 25% | ||
ethical-ai | 0 | 4,773,994,782 | 25% | ||
jwaser | 0 | 5,560,521,280 | 25% | ||
damarth | 0 | 721,207,416 | 3% | ||
ellepdub | 0 | 416,813,362 | 25% | ||
rynow | 0 | 11,247,612,636 | 2% | ||
herpetologyguy | 0 | 48,204,378,993 | 25% | ||
strong-ai | 0 | 4,055,706,859 | 25% | ||
siniceku | 0 | 71,835,822 | 100% | ||
luneknight | 0 | 386,023,308 | 100% | ||
lalala | 0 | 123,576,474,657 | 100% | ||
dapeng | 0 | 81,729,775,637 | 100% | ||
devilwsy | 0 | 2,208,397,243 | 100% | ||
janiceting | 0 | 2,206,103,319 | 100% | ||
lydiachan | 0 | 25,613,783,523 | 100% | ||
technoprogressiv | 0 | 3,075,195,955 | 25% | ||
jackhircus | 0 | 133,433,605,251 | 72% | ||
blackbunny | 0 | 104,794,814,030 | 100% | ||
chessmasterhex | 0 | 176,058,230 | 100% | ||
lingfei | 0 | 64,780,334,542 | 100% | ||
yyyy | 0 | 450,469,190 | 100% | ||
melip | 0 | 33,809,424,079 | 25% | ||
wylo | 0 | 606,832,249 | 100% | ||
cryptoted | 0 | 112,853,322 | 100% | ||
jkkim | 0 | 76,723,970 | 10% | ||
victorier | 0 | 81,594,580,217 | 100% | ||
exec | 0 | 84,007,409,160 | 100% | ||
eval | 0 | 793,450,320 | 100% | ||
aaronli | 0 | 20,770,220,105 | 50% | ||
that1consultant | 0 | 300,841,625 | 100% | ||
sanzo | 0 | 332,990,081 | 100% | ||
sweetieprincess | 0 | 31,139,793,747 | 50% | ||
travelgirl | 0 | 57,725,182,477 | 46% | ||
zeekcryptominer | 0 | 307,368,503 | 100% | ||
catwomanteresa | 0 | 42,584,452,252 | 40% | ||
syh7758520 | 0 | 5,616,045,982 | 100% | ||
liangfengyouren | 0 | 1,519,282,285 | 50% | ||
idx | 0 | 16,866,696,490 | 100% | ||
mangoanddaddy | 0 | 1,749,028,021 | 80% | ||
marcoharley1995 | 0 | 609,061,897 | 100% | ||
fr3eze | 0 | 75,494,916,672 | 50% | ||
nainaztengra | 0 | 262,603,062,097 | 100% | ||
tvb | 0 | 35,150,310,243 | 50% | ||
skenan | 0 | 84,858,819,578 | 50% | ||
jessie901220 | 0 | 16,852,973,591 | 100% | ||
davidke20 | 0 | 1,780,209,941 | 10% | ||
dgorbunov | 0 | 553,879,071 | 100% | ||
ms8988 | 0 | 599,436,277 | 100% | ||
kettleandseagull | 0 | 10,485,578,669 | 100% | ||
xiaoshancun | 0 | 432,028,683 | 100% | ||
bobdos | 0 | 213,349,727,548 | 100% | ||
lindalex | 0 | 231,636,280 | 50% | ||
winniex | 0 | 3,297,025,993 | 10% | ||
kimxinfo | 0 | 8,815,654,225 | 100% | ||
windowglass | 0 | 17,287,093,064 | 50% | ||
cnbuddy | 0 | 4,343,414,840 | 0.1% | ||
chann | 0 | 4,998,233,548 | 20% | ||
santiagocazorla | 0 | 611,934,887 | 100% | ||
lebin | 0 | 25,054,964,839 | 5% | ||
itchyfeetdonica | 0 | 14,200,972,183 | 100% | ||
coindzs | 0 | 168,186,694 | 100% | ||
antonsteemit | 0 | 11,552,609,330 | 75% | ||
cathvanlael | 0 | 121,351,653 | 100% | ||
thetroublenotes | 0 | 188,244,259 | 1% | ||
meixia | 0 | 3,037,940,784 | 100% | ||
comingback | 0 | 256,074,360 | 12% | ||
yjcps | 0 | 1,898,879,342 | 100% | ||
btccurrency1 | 0 | 54,738,143 | 100% | ||
ethanlee | 0 | 10,782,743,307 | 100% | ||
eondas | 0 | 458,430,393 | 100% | ||
fucktime | 0 | 470,065,381,285 | 13% | ||
liuzg | 0 | 309,095,512 | 100% | ||
honoru | 0 | 606,156,293 | 50% | ||
lzg | 0 | 258,724,460 | 50% | ||
fishlucy | 0 | 23,223,596,820 | 50% | ||
pgr | 0 | 215,436,378 | 25% | ||
china-mobile | 0 | 550,319,762 | 100% | ||
xiaoyuanwmm | 0 | 239,548,013 | 100% | ||
tydebbie | 0 | 1,014,431,492 | 50% | ||
ybeyond | 0 | 124,111,769 | 100% | ||
team-cn | 0 | 121,910,338,157 | 100% | ||
weitz | 0 | 257,134,952 | 50% | ||
hardmetal | 0 | 442,457,803 | 100% | ||
tecire | 0 | 606,678,485 | 100% | ||
jerseymikes | 0 | 606,270,868 | 100% | ||
coder-bts | 0 | 11,767,425,430 | 100% | ||
chick-fil-a | 0 | 608,182,913 | 100% | ||
redlobster | 0 | 610,799,833 | 100% | ||
fiveguys | 0 | 608,285,680 | 100% | ||
marcoy2j | 0 | 284,386,566 | 50% | ||
yuwen | 0 | 442,572,701 | 100% | ||
shuxue | 0 | 445,667,605 | 100% | ||
yingyu | 0 | 442,947,080 | 100% | ||
wuli | 0 | 436,752,009 | 100% | ||
huaxue | 0 | 436,752,003 | 100% | ||
shengwu | 0 | 439,849,522 | 100% | ||
tiffany4ever | 0 | 116,225,855 | 50% | ||
dealmoon | 0 | 609,296,119 | 100% | ||
moonbbs | 0 | 609,186,117 | 100% | ||
bonefish | 0 | 609,102,486 | 100% | ||
chilis | 0 | 609,141,157 | 100% | ||
olive-garden | 0 | 609,102,486 | 100% | ||
zhuanzhibufu | 0 | 429,359,727 | 100% | ||
shine.wong | 0 | 82,895,179 | 50% | ||
shuxuan | 0 | 482,946,227 | 100% | ||
xiaowucw | 0 | 473,744,837 | 100% | ||
menshealthblog | 0 | 493,532,857 | 100% | ||
new-voices | 0 | 611,895,605 | 100% | ||
nozuonodie | 0 | 611,201,023 | 100% | ||
yamibuy | 0 | 611,201,023 | 100% | ||
zongli | 0 | 433,575,460 | 100% | ||
zhuxi | 0 | 436,832,441 | 100% | ||
jidgabol | 0 | 140,332,782 | 100% | ||
bunnymandy | 0 | 155,740,675 | 50% | ||
teamcn-weekly | 0 | 610,526,137 | 100% | ||
teamcn-news | 0 | 610,526,137 | 100% | ||
roy-rogers | 0 | 610,526,137 | 100% | ||
wenxuecity | 0 | 610,526,137 | 100% | ||
huaren | 0 | 610,529,467 | 100% | ||
mitbbs | 0 | 610,529,467 | 100% | ||
teamcn | 0 | 610,526,137 | 100% | ||
cn-health | 0 | 609,781,973 | 100% | ||
cn-doctors | 0 | 609,781,973 | 100% | ||
wongmanman | 0 | 259,899,521 | 50% | ||
kissfirer | 0 | 608,329,487 | 100% | ||
lkvictor2005 | 0 | 7,390,118,535 | 100% | ||
zhang11001 | 0 | 227,387,153 | 100% |
This is how I'll do: <code> for i in range (1,10): line='' for j in range (1,10): line=line+str(i*j)+'\t' print(line) </code> Results: <pre> 1 2 3 4 5 6 7 8 9 2 4 6 8 10 12 14 16 18 3 6 9 12 15 18 21 24 27 4 8 12 16 20 24 28 32 36 5 10 15 20 25 30 35 40 45 6 12 18 24 30 36 42 48 54 7 14 21 28 35 42 49 56 63 8 16 24 32 40 48 56 64 72 9 18 27 36 45 54 63 72 81 </pre>
author | ace108 |
---|---|
permlink | re-deanliu-da-series-learn-python-with-steem-04-20180802t151821143z |
category | da-learnpythonwithsteem |
json_metadata | {"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"} |
created | 2018-08-02 15:18:21 |
last_update | 2018-08-02 15:18:21 |
depth | 1 |
children | 0 |
last_payout | 2018-08-09 15:18:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 396 |
author_reputation | 1,226,053,539,120,611 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,888,795 |
net_rshares | 0 |
恭喜你!您的这篇文章入选 @justyy 今日 (2018-08-01) 榜单 [【优秀被错过的文章】](https://steemit.com/cn/@justyy/--daily-cn-updates-cncnpower-downyy2018-08-01), 回复本条评论24小时内领赏,点赞本评论将支持 @dailychina 并增加将来您的奖赏。 Congratulations! This post has been selected by @justyy as today's (2018-08-01) [【Good Posts You May Miss】](https://steemit.com/cn/@justyy/--daily-cn-updates-cncnpower-downyy2018-08-01), Steem On! Reply to this message in 24 hours to get rewards. Upvote this comment to support the @dailychina and increase your future rewards! ^_^
author | dailychina |
---|---|
permlink | re-da-series-learn-python-with-steem-04-20180801t080406 |
category | da-learnpythonwithsteem |
json_metadata | "" |
created | 2018-08-01 08:04:06 |
last_update | 2018-08-01 08:04:06 |
depth | 1 |
children | 2 |
last_payout | 2018-08-08 08:04:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.165 HBD |
curator_payout_value | 0.047 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 512 |
author_reputation | 50,124,640,567,504 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,732,316 |
net_rshares | 125,944,833,670 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
deanliu | 0 | 25,472,873,312 | 1% | ||
justyy | 0 | 83,339,620,902 | 5% | ||
happyukgo | 0 | 411,228,751 | 20% | ||
superbing | 0 | 2,977,251,419 | 20% | ||
dailyfortune | 0 | 66,032,285 | 20% | ||
dailystats | 0 | 5,642,949,111 | 20% | ||
dailychina | 0 | 3,839,028,824 | 20% | ||
lordofreward | 0 | 210,174,105 | 0.75% | ||
turtlegraphics | 0 | 2,040,409,560 | 20% | ||
witnesstools | 0 | 1,945,265,401 | 20% |
呵呵,被錯過?不敢這麼說....
author | deanliu |
---|---|
permlink | re-dailychina-re-da-series-learn-python-with-steem-04-20180801t080406-20180801t084921772z |
category | da-learnpythonwithsteem |
json_metadata | {"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"} |
created | 2018-08-01 08:49:21 |
last_update | 2018-08-01 08:49:21 |
depth | 2 |
children | 1 |
last_payout | 2018-08-08 08:49:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.086 HBD |
curator_payout_value | 0.022 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 16 |
author_reputation | 3,091,923,678,819,098 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,736,078 |
net_rshares | 65,436,976,108 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
justyy | 0 | 46,302,218,384 | 3% | ||
happyukgo | 0 | 411,228,751 | 20% | ||
superbing | 0 | 2,977,314,247 | 20% | ||
dailyfortune | 0 | 64,294,593 | 20% | ||
dailystats | 0 | 5,646,436,054 | 20% | ||
dailychina | 0 | 3,839,072,803 | 20% | ||
turtlegraphics | 0 | 2,040,434,691 | 20% | ||
witnesstools | 0 | 1,945,290,532 | 20% | ||
ilovecoding | 0 | 2,210,686,053 | 20% |
感谢刘前辈,明天开始去掉 “被错过”
author | justyy |
---|---|
permlink | re-deanliu-re-dailychina-re-da-series-learn-python-with-steem-04-20180801t080406-20180802t095226346z |
category | da-learnpythonwithsteem |
json_metadata | {"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"} |
created | 2018-08-02 09:52:24 |
last_update | 2018-08-02 09:52:24 |
depth | 3 |
children | 0 |
last_payout | 2018-08-09 09:52:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.030 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 18 |
author_reputation | 280,616,224,641,976 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,859,917 |
net_rshares | 18,428,601,624 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
happyukgo | 0 | 397,975,468 | 20% | ||
superbing | 0 | 2,885,746,693 | 20% | ||
dailyfortune | 0 | 62,556,902 | 20% | ||
dailystats | 0 | 5,474,574,147 | 20% | ||
dailychina | 0 | 3,723,786,202 | 20% | ||
turtlegraphics | 0 | 1,974,778,375 | 20% | ||
witnesstools | 0 | 1,882,721,622 | 20% | ||
ilovecoding | 0 | 2,026,462,215 | 20% |

author | kimxinfo |
---|---|
permlink | re-deanliu-da-series-learn-python-with-steem-04-20180731t081613518z |
category | da-learnpythonwithsteem |
json_metadata | {"community":"busy","app":"busy/2.5.4","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":["https://ipfs.busy.org/ipfs/QmeyycG8dMpzVQMQWWZensPKvtGDWEJEyJLFcjUp85xvAm"]} |
created | 2018-07-31 08:16:12 |
last_update | 2018-07-31 08:16:12 |
depth | 1 |
children | 3 |
last_payout | 2018-08-07 08:16:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.107 HBD |
curator_payout_value | 0.033 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 90 |
author_reputation | 1,748,728,029,640 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,611,485 |
net_rshares | 83,625,360,818 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
deanliu | 0 | 76,395,156,340 | 5% | ||
antonsteemit | 0 | 7,230,204,478 | 48% |
這位大學生怎麼一直來交小學的課堂作業啊~~^_^
author | deanliu |
---|---|
permlink | re-kimxinfo-re-deanliu-da-series-learn-python-with-steem-04-20180731t140922169z |
category | da-learnpythonwithsteem |
json_metadata | {"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"} |
created | 2018-07-31 14:09:21 |
last_update | 2018-07-31 14:09:21 |
depth | 2 |
children | 2 |
last_payout | 2018-08-07 14:09:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 24 |
author_reputation | 3,091,923,678,819,098 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,642,373 |
net_rshares | 9,231,051,545 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
kimxinfo | 0 | 9,231,051,545 | 100% |
嗚...老師不要趕我走
author | kimxinfo |
---|---|
permlink | re-deanliu-re-kimxinfo-re-deanliu-da-series-learn-python-with-steem-04-20180801t011924874z |
category | da-learnpythonwithsteem |
json_metadata | {"community":"busy","app":"busy/2.5.4","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":[]} |
created | 2018-08-01 01:19:21 |
last_update | 2018-08-01 01:19:21 |
depth | 3 |
children | 1 |
last_payout | 2018-08-08 01:19:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 11 |
author_reputation | 1,748,728,029,640 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,699,857 |
net_rshares | 0 |
遲交了的功課,那個Print 的空格怪怪的,有錯嗎? 
author | kona |
---|---|
permlink | re-deanliu-da-series-learn-python-with-steem-04-20180731t185355041z |
category | da-learnpythonwithsteem |
json_metadata | {"tags":["da-learnpythonwithsteem"],"image":["https://cdn.steemitimages.com/DQmNgnGbgYmPz42fArKXui7kcyNZUomWTx6WuSXHFBjJ9DD/hw4.png"],"app":"steemit/0.1"} |
created | 2018-07-31 18:53:57 |
last_update | 2018-07-31 18:53:57 |
depth | 1 |
children | 2 |
last_payout | 2018-08-07 18:53:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.096 HBD |
curator_payout_value | 0.032 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 124 |
author_reputation | 39,758,138,507,499 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,670,181 |
net_rshares | 76,406,682,101 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
deanliu | 0 | 76,406,682,101 | 5% |
@antonsteemit ^_^
author | deanliu |
---|---|
permlink | re-kona-re-deanliu-da-series-learn-python-with-steem-04-20180801t142815172z |
category | da-learnpythonwithsteem |
json_metadata | {"tags":["da-learnpythonwithsteem"],"users":["antonsteemit"],"app":"steemit/0.1"} |
created | 2018-08-01 14:28:15 |
last_update | 2018-08-01 14:28:15 |
depth | 2 |
children | 1 |
last_payout | 2018-08-08 14:28:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 17 |
author_reputation | 3,091,923,678,819,098 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,766,441 |
net_rshares | 0 |
看了上面的大學同學知道不用放end,就這樣print('\n')可以了😅😅
author | kona |
---|---|
permlink | re-deanliu-re-kona-re-deanliu-da-series-learn-python-with-steem-04-20180801t151940586z |
category | da-learnpythonwithsteem |
json_metadata | {"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"} |
created | 2018-08-01 15:19:42 |
last_update | 2018-08-01 15:19:42 |
depth | 3 |
children | 0 |
last_payout | 2018-08-08 15:19:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 37 |
author_reputation | 39,758,138,507,499 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,771,815 |
net_rshares | 0 |
 发现好像python的很多符号和C很像,所以我试了下x++之类的,发现不认,哈哈哈~只能用x+=1这样的,真的没有x++这样的运算方法吗?
author | shine.wong |
---|---|
permlink | re-deanliu-da-series-learn-python-with-steem-04-20180731t052733309z |
category | da-learnpythonwithsteem |
json_metadata | {"tags":["da-learnpythonwithsteem"],"community":"steempeak","app":"steempeak"} |
created | 2018-07-31 05:27:36 |
last_update | 2018-07-31 05:27:36 |
depth | 1 |
children | 2 |
last_payout | 2018-08-07 05:27:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.107 HBD |
curator_payout_value | 0.034 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 156 |
author_reputation | 1,329,335,530,903 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,597,706 |
net_rshares | 84,332,663,430 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
deanliu | 0 | 76,395,156,340 | 5% | ||
antonsteemit | 0 | 7,937,507,090 | 53% |
沒、沒有... 不知道Python為什麼要捨棄這樣的設計,做等其他大神來回答xD
author | antonsteemit |
---|---|
permlink | re-shinewong-re-deanliu-da-series-learn-python-with-steem-04-20180731t150422159z |
category | da-learnpythonwithsteem |
json_metadata | {"community":"busy","app":"busy/2.5.4","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":[]} |
created | 2018-07-31 15:04:24 |
last_update | 2018-07-31 15:04:24 |
depth | 2 |
children | 1 |
last_payout | 2018-08-07 15:04:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 41 |
author_reputation | 7,534,465,964,895 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,648,184 |
net_rshares | 0 |
看来这个问题知道的人不多呀,连老师都不知道~
author | shine.wong |
---|---|
permlink | re-antonsteemit-re-shinewong-re-deanliu-da-series-learn-python-with-steem-04-20180801t010836769z |
category | da-learnpythonwithsteem |
json_metadata | {"tags":["da-learnpythonwithsteem"],"community":"steempeak","app":"steempeak"} |
created | 2018-08-01 01:08:39 |
last_update | 2018-08-01 01:08:39 |
depth | 3 |
children | 0 |
last_payout | 2018-08-08 01:08:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 22 |
author_reputation | 1,329,335,530,903 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,699,054 |
net_rshares | 0 |
OK 交[作业](https://busy.org/@yjcps/learnpythonwithsteem04-0d8jly8ypt)啦 
author | yjcps |
---|---|
permlink | re-deanliu-da-series-learn-python-with-steem-04-20180731t125357577z |
category | da-learnpythonwithsteem |
json_metadata | {"community":"busy","app":"busy/2.5.4","format":"markdown","tags":["da-learnpythonwithsteem"],"users":["yjcps"],"links":["https://busy.org/@yjcps/learnpythonwithsteem04-0d8jly8ypt"],"image":["https://ipfs.busy.org/ipfs/QmZHLz33aMW2mhagrVZabiRs171iLXnb4iqybGpXnJmUUY"]} |
created | 2018-07-31 12:53:57 |
last_update | 2018-07-31 12:53:57 |
depth | 1 |
children | 2 |
last_payout | 2018-08-07 12:53:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.107 HBD |
curator_payout_value | 0.034 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 155 |
author_reputation | 1,019,613,572,923 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,634,928 |
net_rshares | 84,175,485,072 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
deanliu | 0 | 76,395,156,340 | 5% | ||
antonsteemit | 0 | 7,780,328,732 | 51% |
作業是不是太簡單啦xD
author | antonsteemit |
---|---|
permlink | re-yjcps-re-deanliu-da-series-learn-python-with-steem-04-20180731t150455690z |
category | da-learnpythonwithsteem |
json_metadata | {"community":"busy","app":"busy/2.5.4","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":[]} |
created | 2018-07-31 15:04:57 |
last_update | 2018-07-31 15:04:57 |
depth | 2 |
children | 1 |
last_payout | 2018-08-07 15:04:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 11 |
author_reputation | 7,534,465,964,895 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,648,232 |
net_rshares | 0 |
不简单哦,基本功练扎实,很重要。
author | yjcps |
---|---|
permlink | re-antonsteemit-re-yjcps-re-deanliu-da-series-learn-python-with-steem-04-20180801t012645401z |
category | da-learnpythonwithsteem |
json_metadata | {"community":"busy","app":"busy/2.5.4","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":[]} |
created | 2018-08-01 01:26:45 |
last_update | 2018-08-01 01:26:45 |
depth | 3 |
children | 0 |
last_payout | 2018-08-08 01:26:45 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 16 |
author_reputation | 1,019,613,572,923 |
root_title | "[DA series - Learn Python with Steem #04] 迴圈" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,700,403 |
net_rshares | 0 |