Python -Funktion als Argument
def sum(a,b):
return a+b
def calculate(function,a,b):
return function(a,b)
calculate(sum,3,4)
#returns 7
AartvB
def sum(a,b):
return a+b
def calculate(function,a,b):
return function(a,b)
calculate(sum,3,4)
#returns 7
import sys
print ("the script has the name %s" % (sys.argv[0])
def greet(name, msg):
"""This function greets to
the person with the provided message"""
print("Hello", name + ', ' + msg)
greet("Monica", "Good morning!")