Viewing a response to: @kona/re-kona-re-deanliu-da-series-learn-python-with-steem-03-20180730t040612914z
应该是不写东西不符合Python的语法。 在 if True: 的后面要写做出选择后要做的事情,什么都不做写个pass,像这样: ``` python if True: pass ```
author | yjcps |
---|---|
permlink | re-kona-re-kona-re-deanliu-da-series-learn-python-with-steem-03-20180730t044144827z |
category | da-learnpythonwithsteem |
json_metadata | {"community":"busy","app":"busy/2.5.3","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":[]} |
created | 2018-07-30 04:41:45 |
last_update | 2018-07-30 04:41:45 |
depth | 3 |
children | 3 |
last_payout | 2018-08-06 04:41:45 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.033 HBD |
curator_payout_value | 0.009 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 98 |
author_reputation | 1,019,613,572,923 |
root_title | "[DA series - Learn Python with Steem #03] 邏輯判斷" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,466,727 |
net_rshares | 25,198,253,471 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
deanliu | 0 | 25,042,838,164 | 1% | ||
shine.wong | 0 | 155,415,307 | 100% |
如果加了pass为什么再加其他的语句还是会被运行?pass的作用是?
author | shine.wong |
---|---|
permlink | re-yjcps-re-kona-re-kona-re-deanliu-da-series-learn-python-with-steem-03-20180730t044954337z |
category | da-learnpythonwithsteem |
json_metadata | {"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"} |
created | 2018-07-30 04:49:54 |
last_update | 2018-07-30 04:49:54 |
depth | 4 |
children | 2 |
last_payout | 2018-08-06 04:49:54 |
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 | 34 |
author_reputation | 1,329,335,530,903 |
root_title | "[DA series - Learn Python with Steem #03] 邏輯判斷" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,467,316 |
net_rshares | 0 |
 你是说这样的情况吗?pass不是跳过某段程序的意思 pass 是用来占位子的,为了让写的程序符合语法,就像上面那样 我知道的pass有两个作用: 一是像上面那样,什么都不做; 另一个是,还没想好程序的某个功能怎么写,写个pass占位子,以后有思路了再完善程序。
author | yjcps |
---|---|
permlink | re-shinewong-re-yjcps-re-kona-re-kona-re-deanliu-da-series-learn-python-with-steem-03-20180730t052211004z |
category | da-learnpythonwithsteem |
json_metadata | {"community":"busy","app":"busy/2.5.3","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":["https://ipfs.busy.org/ipfs/QmNYpBZS6e7hqFyZsEQcys1EbXtynDdw9AXJhgEpJAAeCr"]} |
created | 2018-07-30 05:22:12 |
last_update | 2018-07-30 05:22:12 |
depth | 5 |
children | 1 |
last_payout | 2018-08-06 05:22:12 |
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 | 218 |
author_reputation | 1,019,613,572,923 |
root_title | "[DA series - Learn Python with Steem #03] 邏輯判斷" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,469,964 |
net_rshares | 0 |
哦,理解了,我以为是整个if内的都pass,看来是我理解错了!多谢!
author | shine.wong |
---|---|
permlink | re-yjcps-re-shinewong-re-yjcps-re-kona-re-kona-re-deanliu-da-series-learn-python-with-steem-03-20180730t052448833z |
category | da-learnpythonwithsteem |
json_metadata | {"tags":["da-learnpythonwithsteem"],"community":"steempeak","app":"steempeak"} |
created | 2018-07-30 05:24:51 |
last_update | 2018-07-30 05:24:51 |
depth | 6 |
children | 0 |
last_payout | 2018-08-06 05:24:51 |
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 | 34 |
author_reputation | 1,329,335,530,903 |
root_title | "[DA series - Learn Python with Steem #03] 邏輯判斷" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,470,185 |
net_rshares | 0 |