'''module adder.py ''' # default arguments are evalutated only once, when the function definitions are processed def addItem(item, theList = []): theList.append(item) #Add item to end of list print(theList) # If we don't know the order of arguments, we can use keyword arguments to give them values by name def roots(a,b,c): print("A=",a) print("B=",b) print("C=",c) # A function can take all 3 types of arguments, in this order def example(arg1, *arg2, **kwargs): print("Arg1: ",arg1) for arg in arg2: print(arg) for key in kwargs.keys(): print(key, ":", kwargs[key]) if __name__ == "__main__": myList = [] addItem(3,myList) addItem(5) addItem(24) addItem(25,myList) roots(1,2,3) roots(a=12,c=19,b=5) example('one', 'two', 3, 'four', val1 = 'my leg!', val2 =[24,25])