Python中pass的用法

PASS顾名思义,就是跳过它,不进行任何的操作。When a statement is required syntactically but the program requires no action.用法如下

第一种:可用在循环中。注意这是个死循环。

1)

Python中pass的用法

Python中pass的用法

2)

Python中pass的用法

Python中pass的用法

第二种  用在Class类中。Creating minimal classes.

第三种 用在Function函数中。As a place-holder for you to keep thinking and work later, and can be silently ignored.But remember to implement it later.

Python中pass的用法