basic constructions notice the two return values which are simply separated by comma when calling the function (and printing)arguments must appear in the same order as in the function definition we would then write print xy(initial_x_velocityinitial_y_velocitytimethe two returned values from the function could alternatively have been assigned to variablese as x_posy_pos xy(initial_x_velocityinitial_y_velocitytimethe variables x_pos and y_pos could then have been printed or used in other ways in the code there are possibilities for having variable number of function input and output parameters (using *args and **kwargs constructions for the argumentshoweverwe do not go further into that topic here variables that are defined inside functione in the last xy functionare local variables this means they are only known inside the function thereforeif you had accidentally used in some calculation outside the functionyou would have got an error message the variable time is defined outside the function and is therefore global variable it is known both outside and inside the function(sif you define one global and one local variableboth with the same namethe function only sees the local oneso the global variable is not affected by what happens with the local variable of the same name the arguments named in the heading of function definition are by rule local variables inside the function if you want to change the value of global variable inside functionyou need to declare the variable as global inside the function that isif the global variable was xwe would need to write global inside the function definition before we let the function change it after function executionx would then have changed value one should strive to define variables mostly where they are needed and not everywhere another very useful way of handling function parameters in pythonis by defining parameters as keyword arguments this gives default values to parameters and allows more freedom in function callssince the order and number of parameters may vary let us illustrate the use of keyword arguments with the function xy assume we defined xy as def xy(tv = = ) acceleration of gravity return *tv * * * ** heret is an ordinary or positional argumentwhereas and are keyword arguments or named arguments generallythere can be many positional arguments and many keyword argumentsbut the positional arguments must always be listed before the keyword arguments in function definition keyword arguments are given default valuesas shown here with and yboth having zero as de