Advertisement
wagner-cipriano

Python def as a function argument

Dec 19th, 2017
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. # -*- coding:UTF-8 -*-
  2. """
  3. Python function as a function argument
  4. Using a function as an argument to another funcion
  5. Usando uma função como argumento para outra função
  6. REF: https://stackoverflow.com/questions/6289646/python-function-as-a-function-argument
  7. """
  8.  
  9. def funcParent(FunChild, t):
  10.     print ('funcParent')
  11.     FunChild(*t)
  12.  
  13. def FunCh(a,b,c):
  14.     print ("param 1: '%s' param 2 '%s' param 3 '%s:%s'"%(a,b, c, type(c)))
  15.  
  16. funcParent(FunCh, ("hello","gnao", 1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement