About 496,000 results
Open links in new tab
  1. Returning Multiple Values in Python - GeeksforGeeks

    May 2, 2023 · In Python, we can return multiple values from a function. Following are different ways 1) Using Object: This is similar to C/C++ and Java, we can create a class (in C, struct) to …

  2. python - Solving Quadratic Equation - Stack Overflow

    Mar 14, 2013 · Below is the Program to Solve Quadratic Equation. For Example: Solve x2 + 3x – 4 = 0. This quadratic happens to factor: x2 + 3x – 4 = (x + 4)(x – 1) = 0. we already know that …

  3. Python: Return Multiple Values from a Function - datagy

    Oct 29, 2021 · Learn how to use Python to return multiple values from your functions, using tuples, lists, and dictionaries to understand function outputs.

  4. Python Program to Return Multiple Values From a Function

    Example 1: Return values using comma def name(): return "John","Armin" # print the tuple with the returned values print(name()) # get the individual items name_1, name_2 = name() …

  5. Python Function Return Multiple Values: A Comprehensive Guide

    Mar 19, 2025 · Python's ability to return multiple values from a function provides a powerful and flexible programming feature. By using data types like tuples, lists, and dictionaries, …

  6. Multiple Return Values in Python | Learn X By Example

    Python has built-in support for multiple return values. This feature is often used in idiomatic Python, for example, to return both result and error values from a function.

  7. Write a Python Program to Return Multiple Values From a Function

    Apr 26, 2025 · To return multiple values from a function in Python, you need to define the function and use the return statement to return the values as a tuple. Here’s an example: def …

  8. Python function Return Multiple Values [SOLVED] - GoLinuxCloud

    Nov 10, 2022 · Python allows you to return multiple values by separating return values with commas. When multiple values are returned this way, they are actually packed into a single …

  9. python - Is it pythonic for a function to return multiple values ...

    In python, you can have a function return multiple values. Here's a contrived example: def divide(x, y): quotient = x/y remainder = x % y return quotient, remainder (q, r) = divide(22, 7)

  10. Return multiple values from a function in Python - DEV …

    Sep 2, 2021 · In this method, we use Python to return multiple values by simply separating them by commas. Python basically uses a tuple to achieve this. The code to achieve this is as …

  11. Some results have been removed
Refresh