create account

RE: [DA series - Learn Python with Steem #03] 邏輯判斷 by yjcps

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

Viewing a response to: @kona/re-kona-re-deanliu-da-series-learn-python-with-steem-03-20180730t040612914z

· @yjcps ·
$0.04
应该是不写东西不符合Python的语法。
在 if True: 的后面要写做出选择后要做的事情,什么都不做写个pass,像这样:

``` python
if True:
    pass
```
👍  ,
properties (23)
authoryjcps
permlinkre-kona-re-kona-re-deanliu-da-series-learn-python-with-steem-03-20180730t044144827z
categoryda-learnpythonwithsteem
json_metadata{"community":"busy","app":"busy/2.5.3","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":[]}
created2018-07-30 04:41:45
last_update2018-07-30 04:41:45
depth3
children3
last_payout2018-08-06 04:41:45
cashout_time1969-12-31 23:59:59
total_payout_value0.033 HBD
curator_payout_value0.009 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length98
author_reputation1,019,613,572,923
root_title"[DA series - Learn Python with Steem #03] 邏輯判斷"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,466,727
net_rshares25,198,253,471
author_curate_reward""
vote details (2)
@shine.wong ·
如果加了pass为什么再加其他的语句还是会被运行?pass的作用是?
properties (22)
authorshine.wong
permlinkre-yjcps-re-kona-re-kona-re-deanliu-da-series-learn-python-with-steem-03-20180730t044954337z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"app":"steemit/0.1"}
created2018-07-30 04:49:54
last_update2018-07-30 04:49:54
depth4
children2
last_payout2018-08-06 04:49: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_length34
author_reputation1,329,335,530,903
root_title"[DA series - Learn Python with Steem #03] 邏輯判斷"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,467,316
net_rshares0
@yjcps ·
![图片.png](https://ipfs.busy.org/ipfs/QmNYpBZS6e7hqFyZsEQcys1EbXtynDdw9AXJhgEpJAAeCr)

你是说这样的情况吗?pass不是跳过某段程序的意思
pass 是用来占位子的,为了让写的程序符合语法,就像上面那样

我知道的pass有两个作用:
一是像上面那样,什么都不做;
另一个是,还没想好程序的某个功能怎么写,写个pass占位子,以后有思路了再完善程序。
properties (22)
authoryjcps
permlinkre-shinewong-re-yjcps-re-kona-re-kona-re-deanliu-da-series-learn-python-with-steem-03-20180730t052211004z
categoryda-learnpythonwithsteem
json_metadata{"community":"busy","app":"busy/2.5.3","format":"markdown","tags":["da-learnpythonwithsteem"],"users":[],"links":[],"image":["https://ipfs.busy.org/ipfs/QmNYpBZS6e7hqFyZsEQcys1EbXtynDdw9AXJhgEpJAAeCr"]}
created2018-07-30 05:22:12
last_update2018-07-30 05:22:12
depth5
children1
last_payout2018-08-06 05: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_length218
author_reputation1,019,613,572,923
root_title"[DA series - Learn Python with Steem #03] 邏輯判斷"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,469,964
net_rshares0
@shine.wong ·
哦,理解了,我以为是整个if内的都pass,看来是我理解错了!多谢!
properties (22)
authorshine.wong
permlinkre-yjcps-re-shinewong-re-yjcps-re-kona-re-kona-re-deanliu-da-series-learn-python-with-steem-03-20180730t052448833z
categoryda-learnpythonwithsteem
json_metadata{"tags":["da-learnpythonwithsteem"],"community":"steempeak","app":"steempeak"}
created2018-07-30 05:24:51
last_update2018-07-30 05:24:51
depth6
children0
last_payout2018-08-06 05:24:51
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_reputation1,329,335,530,903
root_title"[DA series - Learn Python with Steem #03] 邏輯判斷"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,470,185
net_rshares0