control structures and functions can of course accept both variable number of positional arguments and variable number of keyword argumentsdef print_args(*args**kwargs)for iarg in enumerate(args)print("positional argument { { }format(iarg)for key in kwargsprint("keyword argument { { }format(keykwargs[key])this function just prints the arguments it is given it can be called with no argumentsor with any number of positional and keyword arguments accessing variables in the global scope |it is sometimes convenient to have few global variables that are accessed by various functions in the program this is usually okay for "constants"but is not good practice for variablesalthough for short one-off programs it isn' always unreasonable the digit_names py program takes an optional language ("enor "fr"and number on the command line and outputs the names of each of the digits it is given so if it is invoked with " on the command lineit will output "one two threethe program has three global variableslanguage "enenglish { "zero" "one" "two" "three" "four" "five" "six" "seven" "eight" "nine"french { "zero" "un" "deux" "trois" "quatre" "cinq" "six" "sept" "huit" "neuf"we have followed the convention that all uppercase variable names indicate constantsand have set the default language to english (python does not provide direct way to create constantsinstead relying on programmers to respect the convention elsewhere in the program we access the language variableand use it to choose the appropriate dictionary to usedef print_digits(digits)dictionary english if language ="enelse french for digit in digitsprint(dictionary[int(digit)]end="print(when python encounters the language variable in this function it looks in the local (functionscope and doesn' find it so it then looks in the global py filescopeand finds it there the end keyword argument used with the first print(call is explained in the sidebar "the print(function