【发布时间】:2016-01-24 00:44:15
【问题描述】:
我在python中发现了一段有趣的代码:
def x(cond):
if cond:
pass
print('Still running!')
x(True)
我希望这不会打印任何内容,但它会打印 Still running!。这里发生了什么?
【问题讨论】:
-
@Downvoters 为什么?我知道
pass函数是如何工作的(占位符说I need an implementation!),我只是不知道它是如何工作的。
标签: python python-3.x