# Author: James Tam # Version: October 14, 2024 # Learning objectives: how define and call a function with default arguments. #Will work: uses keyword arguments where the names match. def fun1(aStr,aNum): print(aNum,aStr) #Will work: no keywork arguments def fun2(localNum,localString): print(localNum,localString) #Won't work as the names don't match up during the function call vs. the function definition. def fun3(aNum1,aStr1): print(aNum1,aStr1) def start(): print("fun1(), using keyword arguments: ", end="") fun1(aNum=888,aStr="Lucky") aNum=777 print("fun2(), using normal positional arguments: ", end="") fun2(aNum,"Also lucky") print("fun3(), using keyword arguments but names don't match: ") fun3(aNum=888,aStr="lucky") start()