Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
## Creating a global variable
a = "Hello! Welcome to python tutorials."
def func():
## It will automatically takes the value of global variable as we didn't define any other local variable "a" inside fubction.
print(a)
## Calling the function toc check what value of "a" will it print.
func()
#[Output]:
Hello! Welcome to python tutorials.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.