[英]Python double print function, I don't understand how this example works
Why does the code?为什么是代码?
print(print("Hello"))
send back to the user.发回给用户。
hello
none
I don't get it.我不明白。
print
is function which does return None
and have side effect of printing print
是return None
并具有打印副作用的函数
print("Hello")
does print Hello
and return None
so external print
does "see" that its' 1st argument is None
and print that确实打印
Hello
并return None
所以外部print
确实“看到”它的'第一个参数是None
并打印
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.