- pass语句什么也不做,一般作为占位符或者创建占位程序,pass语句不会执行任何操作
- 保证代码结构格式完整
- 当你还没想清楚函数内部内容,就可以用pass来进行填坑
def fun_a(*args):
try:
with open(str_log, 'a') as file:
sys.stdout = file
print(*args)
except Exception as e:
pass
遇到错误执行except代码块,pass忽略错误



