简体   繁体   中英

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("Hello")

does print Hello and return None so external print does "see" that its' 1st argument is None and print that

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM