""" try_changing_number.py try to change a variable in place. Fail. $ python try_changing_number.py in main : n is 10 in double in place - the number is 10 in double_in_place - the new number is 20 in main : n is now 10 """ def double_in_place(number): """ try to change the variable in the calling routine """ print(" in double in place - the number is ", number) number = 2 * number print(" in double_in_place - the new number is ", number) def main(): n = 10 print("in main : n is ", n) double_in_place(n) # this does not change n ! print("in main : n is now ", n) main()