
Difference between returns and printing in python? [duplicate]
In python I don't seem to be understanding the return function. Why use it when I could just print it?
ELI5 The difference between “print” and “return” - Reddit
Return is how python tells itself something, print is how python tells a user something. So return passes information from one bit of code to another inside python without you seeing anything, …
python - What is the formal difference between "print" and "return ...
Dec 11, 2017 · The reason you see return ed values printed to the screen is because you are probably working in the interactive Python shell that automatically print s any result for your …
python - What is the purpose of the return statement? How is it ...
What does the return statement do? How should it be used in Python? How does return differ from print? See also Often, people try to use print in a loop inside a function in order to see …
python - return vs print list - Stack Overflow
Aug 31, 2015 · Very new to programming. Wondering why does this example print all the items in the list, while the second example prints only the first? def list_function(x): for y in x: print(y) n =...
¿Cuál es la diferencia entre "print" y "return" al final de una …
Jan 19, 2021 · El return te devuelve un valor de resultado en caso de ejecutarse una operacion, el print escribe en la consola. print () sirve para mostrar un mensaje en la pantalla de una …
python: return, return None, and no return at all -- is there any ...
Either all return statements in a function should return an expression, or none of them should. If any return statement returns an expression, any return statements where no value is returned …
Print vs return : r/learnpython - Reddit
Apr 19, 2023 · print() is a builtin function in Python that will instruct to output to stdout. Like echo command does in shell scripts. return is a builtin statement in Python, which will go back to the …
python - use of Return vs Print inside a function - Stack Overflow
Mar 10, 2023 · Where in the function are you returning anything? Presumably you simply replaced print (i, end="") with a return statement, which would expectedly return on the first iteration of …
The difference between ‘print’ and ‘return’ in Python
Mar 20, 2018 · In python 3 print is a function that prints to the console. return is a type of statement that ends execution of a function and returns the specified value to whoever called …