global variables (ones that belong to the global scope) a | b | c ------------------ 3 | 4 | 5 # initial values of these variables 3 | 9 | 5 # b = mystery(c, a) = mystery(5, 3) = 9 local variables (ones that belong to `mystery`) a | b | c ------------------ 5 | 3 | # the call is mystery(5, 3), so a = 5, b = 3 5 | 3 | 9 # a > b, so c = a + 4 = 5 + 4 = 9 output ------ 5 3 # printed by mystery 3 9 5 # printed by the final statement in the program c is still 5 at the end of the program because there are two different variables called c -- one that belongs to mystery, and one that belongs to the global scope. The global c is assigned 5, and after that it is never changed. The local c (the one that belongs to mystery) is assigned 9, but that doesn't change the global c.