0
Mystery (None) after printing a function, which prints a variable. Why is it there?
PY Printing a function, why is there a "None" at the end? https://code.sololearn.com/cJ4C9gF9lSnN/?ref=app
2 Réponses
+ 3
Mika Hämäläinen
Summary is this + what codemonkey has said:
if your code has a return output, you call it with a print() else if it has a print output, call it without the print.
Example:
def func():
print("yes")
func()
def func2():
return "yes"
print(func2())
Happy Coding 😀😀
+ 1
Thx codemonkey and Tomiwa Joseph
I"ll try to remember this. 🤓