How to use the pass statement?

前端 未结 15 2497
旧时难觅i
旧时难觅i 2020-11-22 15:03

I am in the process of learning Python and I have reached the section about the pass statement. The guide I\'m using defines it as being a Null sta

15条回答
  •  一整个雨季
    2020-11-22 15:30

    as the book said, I only ever use it as a temporary placeholder, ie,

    # code that does something to to a variable, var
    if var == 2000:
        pass
    else:
        var += 1
    

    and then later fill in the scenario where var == 2000

提交回复
热议问题