Skip to content

Instantly share code, notes, and snippets.

@Robofied
Created February 3, 2019 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Robofied/194e10ab942cdf0ba0fdd44a20fa2674 to your computer and use it in GitHub Desktop.
Save Robofied/194e10ab942cdf0ba0fdd44a20fa2674 to your computer and use it in GitHub Desktop.
## 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