
Difference between returns and printing in python? [duplicate]
4 For more complex calculations, you need to return intermediate values. For instance: print minimum(3, maximum(4, 6)) You can't have maximum printing its result in that case.
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 …
Print vs return : r/learnpython - Reddit
The print() function displays something to the screen, or writes to a file/stream, whereas return sends a value from a function to a variable elsewhere for further processing. We pass values …
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 …
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 …
Return vs Print : r/learnpython - Reddit
Jul 16, 2020 · Typically best practise is to have your function return strings, and then print the returned strings. This is so that you can re-use your function, and to keep your function from …
python - Return vs Print in functions using a list of lists - Stack ...
Aug 31, 2015 · How can I use `return` to get back multiple values from a loop? Can I put them in a list? (2 answers) Closed 10 years ago. I'm having some unexpected results with trying to …
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 …
Return vs Print : r/learnpython - Reddit
Jan 5, 2020 · If a function in python does not explicitly return a value the value the function returns is 'None'. So in your first case you do not execute a return statement so the value returned by …