About 7,660,000 results
Open links in new tab
  1. Python - Passing a function into another function - Stack Overflow

    How can I pass a function into another function in Python? Example. if rules == True: do... else: do... if "variable_name1" in v: return False. elif "variable_name2" in v: return False. else: return …

  2. python - Using the output of a function as an input of another function ...

    Nov 4, 2020 · You should probably go do a python intro course. def add(a, b): return a + b def mult(a, b): return a * b def add_and_mult(a, b): added = add(a, b) multed = mult(a, b) return …

  3. Python 3, Passing data from one function to another

    You can return two things at once from any function, but you can only use one return statement. by using return x, y this returns a tuple (x, y), which you can use in your main function. value1 …

  4. python - How to pass an input of a function into another function ...

    Jan 29, 2021 · How do I pass an input of a function into another function without the input being asked twice. My code looks like that: def function(): signal_0 = 1 signal_1 = input("0 or 1?")

  5. Python – Call function from another function - GeeksforGeeks

    Jul 1, 2024 · In Python, any written function can be called by another function. Note that this could be the most elegant way of breaking a problem into chunks of small problems. In this article, …

  6. Use return value in another function - Python Help

    Jul 9, 2022 · Let me describe a situation: Function 1: def get_list(*key): headers_list = { "Accept": "application/json", } getlst = requests.get("https://api.example.com/v3.0/api/Menu/List", …

  7. Passing a function as an argument to another function in Python

    Jan 14, 2020 · All functions in Python can be passed as an argument to another function (that just happens to be the sole purpose of lambda functions). A common example: key functions. …

  8. Passing functions as arguments to other functions - Python

    Jun 3, 2021 · In Python, you can pass functions (as an argument) to another function. Some of Python's built-in functions actually expect functions to be given as one or more of their …

  9. How to access a variable in one python function in another function

    Dec 11, 2018 · I want to use a variable declared inside a function to be used in another function. global is the only way without using return. Just have one function call reference the global …

  10. How to Call a Function Within a Function in Python? - Python

    Feb 10, 2025 · Learn how to call a function within a function in Python using nested functions, closures, and `*args` and `**kwargs` for efficient and modular code execution!

  11. Some results have been removed
Refresh