Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

fastest way to iterate dictionary python

# iterating through dictionary keys fast
dictKeys = list(nameOfDict.keys())

for i in range(len(dictKeys)):
  print(dictKeys[i])
  
  
# iterating through dictionary values fast
dictValues = list(nameOfDict.values())

for i in range(len(dictKeys)):
  print(dictKeys[i])
Source by xahlee.info #
 
PREVIOUS NEXT
Tagged: #fastest #iterate #dictionary #python
ADD COMMENT
Topic
Name
9+9 =