draw electric
draw electric

Reputation: 17

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.

Upvotes: 0

Views: 66

Answers (1)

Daweo
Daweo

Reputation: 36680

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

Upvotes: 1

Related Questions