pass就是什么也不做,只是为了防止语法错误,比如:
if a>1:pass #我这里先不做任何处理,直接跳过,但是如果不写pass,就会语法错误
如果解决了您的问题请采纳!
如果未解决请继续追问
是的。pass是python中的保留字,pass语句又称为空语句或占位语句。Pythonpass是空语句,是为了保持程序结构的完整性。pass不做任何事情,一般用做占位语句。
python3.3.2中的关键字如下:The following identifiers are used as reserved words, or keywords of the language, and cannot be used as ordinary identifiers. They must be spelled exactly as written here:
False class finallyis return
None continue forlambda try
True deffrom nonlocal while
anddelglobal notwith
as elif if or yield
assert else import pass
break except in raise
共33个。想更好的学习python请关注微信公众号“Python基础教程”!