问题
I'm testing out repl.it (running Python 3.5.1) and I noticed that after every line of input into the console, the console replies with None. I'm not using any fancy definitions with forgotten return values, this happens even after assignment statements. What is going on here?
Example:
x,y,z=1,2,3
=> None
print(x+y+z)
6
=> None
回答1:
None is the default return value of statements that do not have a return value. Some interpreter shells display it, some don't.
It's perfectly normal, don't worry about it.
来源:https://stackoverflow.com/questions/38747994/why-does-this-return-none