create account

RE: [DA series - Learn Python with Steem #05] 基本資料結構 by kona

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @deanliu/da-series-learn-python-with-steem-05

· @kona ·
$0.08
![hw5.png](https://cdn.steemitimages.com/DQmXudTPf3vC8mtofdVbEdtP4pUAWXMgwT7rB7WmCAA8iHC/hw5.png)

Dictionary 不懂使用.format(key,value),所以多了{ },怎麼辦?
👍  ,
properties (23)
authorkona
permlinkre-deanliu-da-series-learn-python-with-steem-05-20180802t034140836z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"image":["https://cdn.steemitimages.com/DQmXudTPf3vC8mtofdVbEdtP4pUAWXMgwT7rB7WmCAA8iHC/hw5.png"],"app":"steemit/0.1"}
created2018-08-02 03:41:42
last_update2018-08-02 03:41:42
depth1
children5
last_payout2018-08-09 03:41:42
cashout_time1969-12-31 23:59:59
total_payout_value0.066 HBD
curator_payout_value0.010 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length145
author_reputation39,758,138,507,499
root_title"[DA series - Learn Python with Steem #05] 基本資料結構"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,831,307
net_rshares45,480,515,568
author_curate_reward""
vote details (2)
@antonsteemit ·
若是印出整個dictionary 就會有含 `{}`
你的`hw_list`本身就是一個字典,所以直接印出來就會出現 {}包在字典外圍。

`.format`的用法是將字串中的某一個東西取代為函數中的東西
例如`' 今天是 {} 月 {} 日'.format(5,19)`
就會分別把5, 19填入兩個框框之中: `今天是5月5日`
以你的例子可以寫成:
`print(' {} : {} :{} '.format(m, hw_list[m], a))`

properties (22)
authorantonsteemit
permlinkre-kona-re-deanliu-da-series-learn-python-with-steem-05-20180805t124753150z
categoryda-learnpythonwithsteem
json_metadata{"community":"busy","app":"busy/2.5.4","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":[]}
created2018-08-05 12:47:54
last_update2018-08-05 12:47:54
depth2
children1
last_payout2018-08-12 12:47: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_length229
author_reputation7,534,465,964,895
root_title"[DA series - Learn Python with Steem #05] 基本資料結構"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,187,276
net_rshares0
@kona ·
明白,謝謝解答,讓我再試試🙏🙏🙏
properties (22)
authorkona
permlinkre-antonsteemit-re-kona-re-deanliu-da-series-learn-python-with-steem-05-20180805t130246417z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-08-05 13:02:48
last_update2018-08-05 13:02:48
depth3
children0
last_payout2018-08-12 13:02: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_length16
author_reputation39,758,138,507,499
root_title"[DA series - Learn Python with Steem #05] 基本資料結構"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,188,488
net_rshares0
@deanliu ·
@antonsteemit ... 

Posted using [Partiko Android](https://play.google.com/store/apps/details?id=io.partiko.android)
properties (22)
authordeanliu
permlinkdeanliu-re-kona-re-deanliu-da-series-learn-python-with-steem-05-20180802t035929365z
categoryda-learnpythonwithsteem
json_metadata{"app":"partiko"}
created2018-08-02 03:59:30
last_update2018-08-02 03:59:30
depth2
children2
last_payout2018-08-09 03:59:30
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_length116
author_reputation3,091,849,028,440,377
root_title"[DA series - Learn Python with Steem #05] 基本資料結構"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,832,836
net_rshares0
@nostalgic1212 ·
你這個呼叫外援的操作真的666666🤦‍♀️
properties (22)
authornostalgic1212
permlinkre-deanliu-deanliu-re-kona-re-deanliu-da-series-learn-python-with-steem-05-20180802t042253954z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-08-02 04:22:54
last_update2018-08-02 04:22:54
depth3
children1
last_payout2018-08-09 04:22: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_length22
author_reputation1,485,097,650,632,524
root_title"[DA series - Learn Python with Steem #05] 基本資料結構"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,834,671
net_rshares0
@deanliu ·
他不是外援,是老師,我只是討論課綱的跟開教室的人 LOL
properties (22)
authordeanliu
permlinkre-nostalgic1212-re-deanliu-deanliu-re-kona-re-deanliu-da-series-learn-python-with-steem-05-20180802t141044248z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-08-02 14:10:45
last_update2018-08-02 14:10:45
depth4
children0
last_payout2018-08-09 14:10: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_length28
author_reputation3,091,849,028,440,377
root_title"[DA series - Learn Python with Steem #05] 基本資料結構"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,882,061
net_rshares0