The global variables can be used throughout the program.
a = 100
def fun1():
print('Number is:', a)
fun1()
If the global variable is accessed inside a function and its value is changed inside a function, then it is limited to that function itself.
def fun2():
a = 200
print("Fun2 number is:", a)
fun2()
print(a)
The link to the Github repository is here .