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

  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 …

  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, …

  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 …

  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 …

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

    Jan 19, 2021 · 0 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 …

  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 …

  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 …

  10. Print vs Return in Python Function - Stack Overflow

    Jun 2, 2020 · For example, if we create a function to print the minimum number from a list, we can do this: def print_min(values): print(min(values)) print_min([3, 41, 12, 9, 74, 15]) Note that the …