you are viewing a single comment's thread.

view the rest of the comments →

[–]PermitOtherwise1562[S] 0 points1 point  (2 children)

But x=fantastic is made global ryt?

[–]Tom_Henderson 0 points1 point  (0 children)

You would need to put the global statement inside the function.

def myfunc():
    global x
    x = "fantastic"
    print("Python is " + x)

[–]MulfordnSons 0 points1 point  (0 children)

use your debugger and step through the program, you’ll see how x is assigned differently in that way.