def (al=[]) append(areturn print( ( )print( ( )print( ( )this will print [ [ [ if you don' want the default to be shared between subsequent callsyou can write the function like this insteaddef (al=none)if is nonel [ append(areturn keyword arguments functions can also be called using keyword arguments of the form kwarg=value for instancethe following functiondef parrot(voltagestate=' stiff'action='voom'type='norwegian blue')print("-this parrot wouldn' "actionend='print("if you put"voltage"volts through it "print("-lovely plumagethe"typeprint("-it' "state"!"accepts one required argument (voltageand three optional arguments (stateactionand typethis function can be called in any of the following waysparrot( parrot(voltage= parrot(voltage= action='vooooom'parrot(action='vooooom'voltage= parrot(' million''bereft of life''jump'parrot(' thousand'state='pushing up the daisies' positional argument keyword argument keyword arguments keyword arguments positional arguments positional keyword but all the following calls would be invalidparrot(parrot(voltage= 'dead'parrot( voltage= parrot(actor='john cleese'required argument missing non-keyword argument after keyword argument duplicate value for the same argument unknown keyword argument in function callkeyword arguments must follow positional arguments all the keyword arguments passed must match one of the arguments accepted by the function ( actor is not valid argument for the parrot function)and their order is not important this also includes non-optional arguments ( parrot(voltage= is valid toono argument may receive value more than once here' an example that fails due to this restriction more on defining functions