Created
March 21, 2020 22:05
-
-
Save ispyhumanfly/5b7c56135c993bc30cc4bfae612466c1 to your computer and use it in GitHub Desktop.
Iterating over Dictionaries in Python3 and grabbing values from multi-dimensional arrays
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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