Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #article I got the idea from: https://www.codeproject.com/Articles/1078771/Techniques-for-Avoiding-Code-Duplication#example1
- def func1(func1arg):
- print(func1arg)
- def func2(function_as_an_arg, param):
- """
- :param function_as_an_arg: this can be a functionw
- :type param: object => This parameter can be used as a parameter
- in the second function call.
- """
- function_as_an_arg(param)
- #func1 is passed here and "Jonathan" is the parameter.
- func2(func1, "Jonathan")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement