Just pass it in like any other parameter:
def a(x):
return "a(%s)" % (x,)
def b(f,x):
return f(x)
print b(a,10)
More Related Contents:
- What is first class function in Python
- Python function define: A message will prompt up if missing entering an argument
- Function defined correctly?
- How can I return two values from a function in Python?
- Python function attributes – uses and abuses [closed]
- Ignore python multiple return value
- How to use a return statement in a for loop?
- How do I create a Python function with optional arguments?
- Which is more preferable to use: lambda functions or nested functions (‘def’)?
- How can I use `return` to get back multiple values from a for loop? Can I put them in a list?
- Forced naming of parameters in Python
- How to call function that takes an argument in a Django template?
- Python: return the index of the first element of a list which makes a passed function true
- What does a semicolon do?
- Basic explanation of python functions
- python: how to get information about a function?
- Modifying function arguments
- How to Open a file through python
- Python decorator? – can someone please explain this? [duplicate]
- How to check whether optional function parameter is set
- Is there a function in python to split a word into a list? [duplicate]
- what is the difference between return and break in python?
- Callback function tkinter button with variable parameter [duplicate]
- Reverse a string without using reversed() or [::-1]?
- Why doesn’t an import in an exec in a function work?
- “unpacking” a passed dictionary into the function’s name space in Python?
- Returning tuple with a single item from a function
- Finding Combinations to the provided Sum value
- python function default parameter is evaluated only once? [duplicate]
- Store functions in list and call them later [duplicate]