I know this is a stupid question, but it's happening on my side.
def func():
print(name)
if __name__ == "__main__":
name = "halo"
print(name)
func()
As I know, func( )
can't see name variable.
But its showing "halo" twice.
I am working in PyCharm. Any suggestion? Or python originally works in this way?