def f():
global s
print s
s = "That's clear."
print s
s = "Python is great!"
f()
print s
Output:
Python is great!
That's clear.
That's clear.
as per program, the last print statement should return "s= Python is great" because I think here S should be referred Global variable.
f(). Globals can be accessed and modified in any scope. If you want the last print to output "Python is great", then you should not declaresa global.