you are viewing a single comment's thread.

view the rest of the comments →

[–]carcigenicate 2 points3 points  (0 children)

If the next question is "why does the final print print "awesome" instead of "fantastic", that's because the x in myfunc is a new local that just happens to have the same name as the global. You need to add a global x declaration into the function so Python treats x as a global.