Answers for "how to make local a variable global in Python"

0

how to make local a variable global in Python

# If you use the global keyword, the variable belongs to the global scope:
  
  def myfunc():
  global x
  x = "fantastic"

myfunc()

  
print("Python is " + x)
Posted by: Guest on September-28-2021

Code answers related to "how to make local a variable global in Python"

Python Answers by Framework

Browse Popular Code Answers by Language