About 523,000 results
Open links in new tab
  1. 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?

  2. 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 own convenience.

  3. 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, print outputs …

  4. 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 multiple ...

  5. 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 =...

  6. 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 should …

  7. ¿Cuál es la diferencia entre "print" y "return" al final de una función ...

    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 aplicación de …

  8. 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 that function.

  9. 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 point …

  10. Is it advisable to use print statements in a python function rather ...

    Lets say I have the function: def function(a) c = a+b print(c) Is it advisable to use the print statement in the function to display output rather than placing a return statement at the en...