Advertisement
here2share

# function_name_arg.py

Sep 14th, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. # function_name_arg.py
  2.  
  3. def plus(a, b):
  4.    return a + b
  5.  
  6. def minus(a, b):
  7.     return a - b
  8.  
  9. def result(a, b, func_name):
  10.     return func_name(a,b)
  11.  
  12. print result(9, 3, plus) # 12
  13. print result(9, 3, minus) # 6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement