Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

global keyword python

name = "Abdullah" # creates global variable

def func():
  global name # calls the name variable from global scope
  
  name = "Kemal" # Changes name variable

func()
print(name) # global name variable will be changed because of the global keyword
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #global #keyword #python
ADD COMMENT
Topic
Name
7+6 =