Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

global variable in python

#Create a variable inside a function, with the same name as the global variable

x = "awesome"

def myfunc():
  x = "fantastic"
  print("Python is " + x)

myfunc()

print("Python is " + x)
Source by www.python-kurs.eu #
 
PREVIOUS NEXT
Tagged: #global #variable #python
ADD COMMENT
Topic
Name
5+6 =