DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
Python Using Global and Local variables in the same code
x = "global " def foo(): global x y = "local" x = x * 2 print(x) print(y) foo()
PREVIOUS
NEXT
Tagged:
#Python
#Using
#Global
#Local
#variables
#code
ADD COMMENT
Topic
COMMENT
Name
6+2 =
Submit