Correctly update global variable

We want to use the function func to update the global variable x. But when we run the code, the value of global x is not updated. Adjust the code so that the final value of global x is 2.
Get a premium membership to access this content: