create account

[DA series - Learn Python with Steem #02] 變數與資料型態 by deanliu

View this thread on: hive.blogpeakd.comecency.com
· @deanliu · (edited)
$33.69
[DA series - Learn Python with Steem #02] 變數與資料型態
[[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 #01] 安裝Python、文字編輯器與哈囉!](https://steemit.com/da-learnpythonwithsteem/@deanliu/da-series-learn-python-with-steem-01-python)

https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmbeN1PpqQC2JE5HbpXatb3apUfFhe68fPLctT95FiiRHq/cover.png

第#02堂課,我們要從根基開始打底囉:先來學學 **變數與資料型態** 吧!

## Python的變數

今天我們要來介紹在程式語言裡面,一個非常基本也重要的的元素:**變數**。在程式的運行過程中,變數是一個被操作的主體。我們會利用變數儲存不一樣的資訊,並且彼此交互運算。

例如我們要寫一個程式計算自己的薪水,我們用變數`work_hour`來紀錄我們今天工作了多久,用`dollar_per_hour` 紀錄了一小時的薪水。接著下一步我們透過數學的乘法運算(*)來成功算出一天的薪水,並把它的值存在`salary_per_day`這個變數裡面。

![](https://cdn.steemitimages.com/DQmb9JQXc8EvF5K1wwW9opCPRdy9AAS1WqgecYbw9ADHygA/image.png)

注:本篇教學的程式碼可至[GitHub/tutorial_2.py](https://github.com/antoncoding/Python-x-Steem-tutorial/blob/master/tutorial_2.py)中參考或下載。

在上面的語法中,`=`的作用就是「賦值」,其實跟小時候寫二元一次方程式x=1, y=2是一樣的。但是程式中我們如果都只使用x, y這種東西當變數名稱的話,我們很快就會忘記他代表的意義了,所以都會在命名上稍微花一點心思,訂一個看了一目了然的名字。

我把這個檔案存檔為`example1_variable.py`,一樣利用command line執行之後就會顯示我們一天的工錢:110塊。

得到這個`salary_per_day`之後,我們還可以把他拿來做各種事。例如算一週薪水、一個月的薪水、一年的薪水等等。

![](https://cdn.steemitimages.com/DQmRNt2L3ir5w5wVsSibNdhULuKxAS19tLMNorv1cEr4RDA/image.png)

執行結果:
```
550
2200
26400
```

變數的好處還有,寫好這段程式之後,我們只要在程式中改變任何一個變數的值(例如把dollar_per_hour換成10),就可以算出完全不同的結果。這樣我們就可以輕鬆的比較做不同工作,一年賺得錢會差多少了xD

![](https://cdn.steemitimages.com/DQmZotBjzMzyksqZS5MD73STBHx72biPPv9Cgn14EgYwMyE/image.png)

執行結果 `24000`。因此知道每個小時多領一塊錢是多麼重要的了吧!

## 資料型態

在程式語言中,不同變數又會有不同的資料型態(Type),例如有些「年齡是正整數」、「名字是文字字串」等等。這是為了讓程式對於你存在變數裡的資訊有所了解,以便做出正確的運算。

頭昏眼花了嗎?沒關係,看一些幾本例子就會豁然開朗了。

![](https://cdn.steemitimages.com/DQmZ2yJqgizQvin6xM1ZoCFjfB1Puu8cty14cHwUWZyJ43C/image.png)

這裡我宣告了`my_name`這個變數是一個字串(用'' 或是""括號起來),來儲存Anton這個名字。
`my_age`就跟剛剛的薪水一樣,是個未來可能要那來做加減運算的「數字」。
第三個`is_married`就比較特別了,是一種叫做布林值(Boolean Algebra)的型態,此類資料只有兩種狀態,即是真或假、True or False。這個`True of False`在通常被拿來做判斷用,這個在未來我們學判斷式跟迴圈的時候會特別重要。

現在我們用不同種類的資料來紀錄訊息了,但為什麼要這麼做呢?因為不同種類的資料在一般情況下是不能放在一起運算的。而不同的資料型態也被python定義了不同的運算規則。

例如,我們改變程式碼如下:

![](https://cdn.steemitimages.com/DQmassWkkwqaSNfDrxKKfsrVqyndX7wekLk2rTNfK2oT7Lk/image.png)

我們分別來看看三種資料型態經過**乘2**之後會變什麼。會發現執行結果為:
```
AntonAnton
44
0
```

在python的定義中,字串乘以二把字串重複兩次,所以`'Anton'*2 = 'AntonAnton'`。
第二個比較簡單理解,數字的乘法跟我們想像也是一樣的。22 * 2 = 44 。
但最後一個又很奇怪了。原來python在遇到把`True or False`拿來做數學運算時,會把他們視為`1` and `0`。所以這裡`False`*2 被當成了`0*2 = 0`,所以output就變成0了。

所以我們可以看出,有些奇怪屬性做奇怪運算會有難以預期的結果,因此在設計程式時應該很清楚每個變數的屬性、意義,才能避免這些可能讓程式壞掉的地方。這也讓我們看出不同變數種類存在的必要性,因為彼此差異頗大,要完成一項任務往往需要這些不同元素互相幫忙。

下一篇介紹判斷式的介紹中,大家應該就可以有更深刻的體會了。

我們下篇文章再見囉~下課!

![class-377117_1280.jpg](https://cdn.steemitimages.com/DQmbTcEoAB7HRTxy11a1eDN8vREiGqxEMd7P3jJ3TGvGSTv/class-377117_1280.jpg)
<sub>*image - pixabay*</sub>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 80 others
properties (23)
authordeanliu
permlinkda-series-learn-python-with-steem-02
categoryda-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/DQmb9JQXc8EvF5K1wwW9opCPRdy9AAS1WqgecYbw9ADHygA/image.png","https://cdn.steemitimages.com/DQmRNt2L3ir5w5wVsSibNdhULuKxAS19tLMNorv1cEr4RDA/image.png","https://cdn.steemitimages.com/DQmZotBjzMzyksqZS5MD73STBHx72biPPv9Cgn14EgYwMyE/image.png","https://cdn.steemitimages.com/DQmZ2yJqgizQvin6xM1ZoCFjfB1Puu8cty14cHwUWZyJ43C/image.png","https://cdn.steemitimages.com/DQmassWkkwqaSNfDrxKKfsrVqyndX7wekLk2rTNfK2oT7Lk/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-01-python","https://github.com/antoncoding/Python-x-Steem-tutorial/blob/master/tutorial_2.py"],"app":"steemit/0.1","format":"markdown"}
created2018-07-27 05:15:54
last_update2018-07-30 02:29:06
depth0
children23
last_payout2018-08-03 05:15:54
cashout_time1969-12-31 23:59:59
total_payout_value28.633 HBD
curator_payout_value5.060 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,840
author_reputation3,091,849,888,189,995
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,118,516
net_rshares18,292,620,261,925
author_curate_reward""
vote details (144)
@aaronli ·
$0.02
為什麼我當年學的是C++
👍  
properties (23)
authoraaronli
permlinkre-deanliu-da-series-learn-python-with-steem-02-20180727t074545976z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-07-27 07:45:45
last_update2018-07-27 07:45:45
depth1
children1
last_payout2018-08-03 07:45:45
cashout_time1969-12-31 23:59:59
total_payout_value0.018 HBD
curator_payout_value0.006 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length12
author_reputation351,839,128,609,435
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,129,454
net_rshares14,031,017,980
author_curate_reward""
vote details (1)
@deanliu ·
成績是C的都是去學C++,已經給你跳兩級了。
properties (22)
authordeanliu
permlinkre-aaronli-re-deanliu-da-series-learn-python-with-steem-02-20180728t081341078z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-07-28 08:13:39
last_update2018-07-28 08:13:39
depth2
children0
last_payout2018-08-04 08:13:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length22
author_reputation3,091,849,888,189,995
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,252,283
net_rshares0
@arcange ·
**WARNING** - The message you received from @dulborah is a **CONFIRMED SCAM**!
**DO NOT FOLLOW** any instruction and **DO NOT CLICK** on any link in the comment!

For more information about this scam, read this post:
https://steemit.com/steemit/@arcange/phishing-site-reported-steem-link-premium
https://steemit.com/steemit/@arcange/anti-phishing-war-the-crooks-continue-their-bashing-campaign

If you find my work to protect you and the community valuable, please consider to upvote this warning or to [vote for my witness](https://steemit.com/~witnesses).
properties (22)
authorarcange
permlinkre-da-series-learn-python-with-steem-02-20180727t102215000z
categoryda-learnpythonwithsteem
json_metadata{"image":["http://i.cubeupload.com/d1Dr28.png"]}
created2018-07-27 08:22:12
last_update2018-07-27 08:22:12
depth1
children0
last_payout2018-08-03 08:22:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length564
author_reputation1,146,622,708,341,708
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,132,295
net_rshares0
@beautypics ·
👍👍👍👍👍👍👍👍💕
properties (22)
authorbeautypics
permlinkre-deanliu-da-series-learn-python-with-steem-02-20180727t060112858z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-07-27 06:00:45
last_update2018-07-27 06:00:45
depth1
children0
last_payout2018-08-03 06:00:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length9
author_reputation10,703,556,924,562
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,121,852
net_rshares0
@dulborah ·
fossbot voter comment
Get Automated DAILY upvotes! FREE

steem.link/more

Get 0.1 Free Steem Just To Join
properties (22)
authordulborah
permlinkre-deanliu-da-series-learn-python-with-steem-02-20180727t052026127z
categoryda-learnpythonwithsteem
json_metadata{}
created2018-07-27 05:20:24
last_update2018-07-27 05:20:24
depth1
children0
last_payout2018-08-03 05:20:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length89
author_reputation-600,108,957,082
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,118,833
net_rshares0
@gamingmemes ·
SOOOOOOO SALLY CAN WAIT!!!!!!!!!!!!!
properties (22)
authorgamingmemes
permlinkre-da-series-learn-python-with-steem-02-20180727t051655
categoryda-learnpythonwithsteem
json_metadata""
created2018-07-27 05:16:57
last_update2018-07-27 05:16:57
depth1
children0
last_payout2018-08-03 05:16:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length37
author_reputation-355,226,318,307
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,118,581
net_rshares0
@justyy ·
$0.03
学习了,拿好小板凳,做好笔记。^_^
👍  , , , , , ,
properties (23)
authorjustyy
permlinkre-deanliu-da-series-learn-python-with-steem-02-20180727t075815631z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-07-27 07:59:03
last_update2018-07-27 07:59:03
depth1
children1
last_payout2018-08-03 07:59:03
cashout_time1969-12-31 23:59:59
total_payout_value0.027 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length18
author_reputation280,616,224,641,976
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,130,508
net_rshares15,669,493,020
author_curate_reward""
vote details (7)
@deanliu ·
發現代碼大神們都喜歡裝小學生,LOL!
properties (22)
authordeanliu
permlinkre-justyy-re-deanliu-da-series-learn-python-with-steem-02-20180728t081203138z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-07-28 08:12:00
last_update2018-07-28 08:12:00
depth2
children0
last_payout2018-08-04 08:12:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length19
author_reputation3,091,849,888,189,995
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,252,141
net_rshares0
@kimxinfo ·
$0.16
![ch2.png](https://ipfs.busy.org/ipfs/QmRJxwCbS5j8ckLYhTpV8p17BwxfJ8TdE6C7i7dN3Urn9u)
👍  ,
properties (23)
authorkimxinfo
permlinkre-deanliu-da-series-learn-python-with-steem-02-20180727t082507568z
categoryda-learnpythonwithsteem
json_metadata{"community":"busy","app":"busy/2.5.3","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":["https://ipfs.busy.org/ipfs/QmRJxwCbS5j8ckLYhTpV8p17BwxfJ8TdE6C7i7dN3Urn9u"]}
created2018-07-27 08:25:06
last_update2018-07-27 08:25:06
depth1
children3
last_payout2018-08-03 08:25:06
cashout_time1969-12-31 23:59:59
total_payout_value0.124 HBD
curator_payout_value0.039 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length86
author_reputation1,748,728,029,640
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,132,477
net_rshares89,695,682,834
author_curate_reward""
vote details (2)
@antonsteemit ·
$0.04
推好學生!
👍  ,
properties (23)
authorantonsteemit
permlinkre-kimxinfo-re-deanliu-da-series-learn-python-with-steem-02-20180727t130302612z
categoryda-learnpythonwithsteem
json_metadata{"community":"busy","app":"busy/2.5.3","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":[]}
created2018-07-27 13:03:06
last_update2018-07-27 13:03:06
depth2
children0
last_payout2018-08-03 13:03:06
cashout_time1969-12-31 23:59:59
total_payout_value0.034 HBD
curator_payout_value0.010 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5
author_reputation7,534,465,964,895
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,156,598
net_rshares24,870,298,189
author_curate_reward""
vote details (2)
@deanliu ·
太多bug了。
👍  
properties (23)
authordeanliu
permlinkre-kimxinfo-re-deanliu-da-series-learn-python-with-steem-02-20180728t081452083z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-07-28 08:14:48
last_update2018-07-28 08:14:48
depth2
children1
last_payout2018-08-04 08:14:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7
author_reputation3,091,849,888,189,995
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,252,382
net_rshares9,231,051,545
author_curate_reward""
vote details (1)
@kimxinfo ·
果然是有天份丫
properties (22)
authorkimxinfo
permlinkre-deanliu-re-kimxinfo-re-deanliu-da-series-learn-python-with-steem-02-20180728t122457405z
categoryda-learnpythonwithsteem
json_metadata{"community":"busy","app":"busy/2.5.3","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":[]}
created2018-07-28 12:24:54
last_update2018-07-28 12:24:54
depth3
children0
last_payout2018-08-04 12:24:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7
author_reputation1,748,728,029,640
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,272,219
net_rshares0
@kona ·
果然進步了,簡化了,方便了,這麽快就有第二堂,看來可以一口氣學下來,期待🤓🤓
properties (22)
authorkona
permlinkre-deanliu-da-series-learn-python-with-steem-02-20180727t053217724z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-07-27 05:32:18
last_update2018-07-27 05:32:18
depth1
children1
last_payout2018-08-03 05:32:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length38
author_reputation39,758,138,507,499
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,119,747
net_rshares0
@deanliu ·
週末休息一下,讓我兒發個燒。>_<
properties (22)
authordeanliu
permlinkre-kona-re-deanliu-da-series-learn-python-with-steem-02-20180728t081412632z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-07-28 08:14:09
last_update2018-07-28 08:14:09
depth2
children0
last_payout2018-08-04 08:14:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length17
author_reputation3,091,849,888,189,995
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,252,326
net_rshares0
@liuzg ·
这比c/c++简单多了

Posted using [Partiko Android](https://play.google.com/store/apps/details?id=io.partiko.android)
properties (22)
authorliuzg
permlinkliuzg-re-deanliu-da-series-learn-python-with-steem-02-20180727t052128162z
categoryda-learnpythonwithsteem
json_metadata{"app":"partiko"}
created2018-07-27 05:21:27
last_update2018-07-27 05:21:27
depth1
children1
last_payout2018-08-03 05:21:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length109
author_reputation20,078,417,529,815
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,118,907
net_rshares0
@antonsteemit ·
真的阿,C++我不敢教,太複雜了。。。
Python真是程式界的救星
properties (22)
authorantonsteemit
permlinkre-liuzg-liuzg-re-deanliu-da-series-learn-python-with-steem-02-20180727t125908612z
categoryda-learnpythonwithsteem
json_metadata{"community":"busy","app":"busy/2.5.3","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":[]}
created2018-07-27 12:59:12
last_update2018-07-27 12:59:12
depth2
children0
last_payout2018-08-03 12:59:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length34
author_reputation7,534,465,964,895
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,156,126
net_rshares0
@liuzg ·
今天没更新呀!

Posted using [Partiko Android](https://play.google.com/store/apps/details?id=io.partiko.android)
properties (22)
authorliuzg
permlinkliuzg-re-deanliu-da-series-learn-python-with-steem-02-20180728t082321544z
categoryda-learnpythonwithsteem
json_metadata{"app":"partiko"}
created2018-07-28 08:23:21
last_update2018-07-28 08:23:21
depth1
children2
last_payout2018-08-04 08:23:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length105
author_reputation20,078,417,529,815
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,253,055
net_rshares0
@deanliu ·
周末休息不學習啊,同學!😄

Posted using [Partiko Android](https://play.google.com/store/apps/details?id=io.partiko.android)
properties (22)
authordeanliu
permlinkdeanliu-re-liuzg-liuzg-re-deanliu-da-series-learn-python-with-steem-02-20180728t083338194z
categoryda-learnpythonwithsteem
json_metadata{"app":"partiko"}
created2018-07-28 08:33:39
last_update2018-07-28 08:33:39
depth2
children1
last_payout2018-08-04 08:33:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length111
author_reputation3,091,849,888,189,995
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,253,874
net_rshares0
@liuzg ·
哦哦。我照常上班,都忘了今天是周末。
祝你周末玩的开心,玩的愉快!

Posted using [Partiko Android](https://play.google.com/store/apps/details?id=io.partiko.android)
properties (22)
authorliuzg
permlinkliuzg-re-deanliu-deanliu-re-liuzg-liuzg-re-deanliu-da-series-learn-python-with-steem-02-20180728t084414296z
categoryda-learnpythonwithsteem
json_metadata{"app":"partiko"}
created2018-07-28 08:44:15
last_update2018-07-28 08:44:15
depth3
children0
last_payout2018-08-04 08:44:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length131
author_reputation20,078,417,529,815
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,254,662
net_rshares0
@shine.wong ·
$0.16
![image.png](https://files.steempeak.com/file/steempeak/shine.wong/jztZVc4p-image.png)
改回3.6.5,我懒得开新文件了,在原来的文件下新增代码并运行~
顺带发现没有申明,没有“;”,几乎一行一条代码以回车来分割,我记得好像有一行N条代码的方法,但是我忘记了,懒得找,坐等后面的教程。
区分大小写的节奏,试过把True改成true报错了,哈哈哈!
👍  ,
properties (23)
authorshine.wong
permlinkre-deanliu-da-series-learn-python-with-steem-02-20180727t055430452z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"community":"steempeak","app":"steempeak"}
created2018-07-27 05:54:33
last_update2018-07-27 05:54:33
depth1
children1
last_payout2018-08-03 05:54:33
cashout_time1969-12-31 23:59:59
total_payout_value0.123 HBD
curator_payout_value0.039 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length216
author_reputation1,329,335,530,903
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,121,398
net_rshares89,398,730,072
author_curate_reward""
vote details (2)
@antonsteemit · (edited)
讚喔! 每行後面不用「;」真的滿方便的啦
properties (22)
authorantonsteemit
permlinkre-shinewong-re-deanliu-da-series-learn-python-with-steem-02-20180727t125802867z
categoryda-learnpythonwithsteem
json_metadata{"community":"busy","app":"busy/2.5.3","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":[]}
created2018-07-27 12:58:06
last_update2018-07-27 13:06:21
depth2
children0
last_payout2018-08-03 12:58:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length20
author_reputation7,534,465,964,895
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,156,005
net_rshares0
@yjcps ·
$0.38
忘了交作业啦[作业](https://busy.org/@yjcps/learnpythonwithsteem02-2ilwe1ti59),哈哈
补上。
👍  
properties (23)
authoryjcps
permlinkre-deanliu-da-series-learn-python-with-steem-02-20180728t122011611z
categoryda-learnpythonwithsteem
json_metadata{"community":"busy","app":"busy/2.5.3","format":"markdown","tags":["da-learnpythonwithsteem"],"users":["yjcps"],"links":["https://busy.org/@yjcps/learnpythonwithsteem02-2ilwe1ti59"],"image":[]}
created2018-07-28 12:20:12
last_update2018-07-28 12:20:12
depth1
children1
last_payout2018-08-04 12:20:12
cashout_time1969-12-31 23:59:59
total_payout_value0.285 HBD
curator_payout_value0.094 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length76
author_reputation1,019,613,572,923
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,271,791
net_rshares212,742,100,162
author_curate_reward""
vote details (1)
@deanliu ·
很棒!各位同學可以去看看這筆記,還補充了不少跟這堂課相關的知識喔!^_^
properties (22)
authordeanliu
permlinkre-yjcps-re-deanliu-da-series-learn-python-with-steem-02-20180728t133104627z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-07-28 13:31:06
last_update2018-07-28 13:31:06
depth2
children0
last_payout2018-08-04 13:31:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length36
author_reputation3,091,849,888,189,995
root_title"[DA series - Learn Python with Steem #02] 變數與資料型態"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,278,551
net_rshares0