While printing the value of x which is the global variable we can see the output as 10 getting printed and while using x+=5 we are getting error why?. if by default x was not referencing to global variable then how it was getting printed when we used print(x) inside the function.
x=10
def show():
print(x)
output is 10
but when x+=5 inside function it throw error. Can you please explain in detail.