You are passing x as the argument of your function myFunction()
.
Thus if x=5
you get:
myFunction(5):
x = 5 + 5
return(x) #10
this is why you are getting 10. If you change x=5
to x=10
you will see that the result of the function will be 20 and so on...
You are not replacing the x
in the function itself. However, the x
you stated will indeed remain a global variable and thus will be printed on the second line.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…