Local and global variable

x=10
def show():
x=5
print(x)
show()

code is giving different output on online compiler as compared to one given in video

Hey @kshitijain05_81c030a813eb8c76 ,
Can you please share both the outputs

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.