DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python declare variables from dictionary
>>> d = {'a':1, 'b':2} >>> for key,val in d.items(): exec(key + '=val')
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#python
#declare
#variables
#dictionary
ADD COMMENT
Topic
COMMENT
Name
8+8 =
Submit