What is the expected output of the following code?

What is the expected output of the following code?
The reason D is the answer because the num variable has no scope within the function. num = num + 3 as we see here is created inside the function. So when we run it, the program doesn't know which num variable to use. so, it would be help full if we type the following: num =1 def func(): global num num = num +3 print(num) func()