Skip to content

Instantly share code, notes, and snippets.

@ispyhumanfly
Created March 21, 2020 22:05
Show Gist options
  • Save ispyhumanfly/5b7c56135c993bc30cc4bfae612466c1 to your computer and use it in GitHub Desktop.
Save ispyhumanfly/5b7c56135c993bc30cc4bfae612466c1 to your computer and use it in GitHub Desktop.
Iterating over Dictionaries in Python3 and grabbing values from multi-dimensional arrays
student = {"name": "John", "age": 25, "courses": ["This", "That", "The Other", "And Another"]}
# Give me the list of all courses available in this Dictionary.
for key, value in student.items():
if key == "courses":
for course in value:
print (course)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment