print dictionary of object python code example
Example 1: python print dictionary line by line
# Iterate over key/value pairs in dict and print them
for key, value in student_score.items():
print(key, ' : ', value)
Example 2: python dictionary
#title :Dictionary Example
#author :Josh Cogburn
#date :20191127
#github :https://github.com/josh-cogburn
#====================================================
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
#Assigning a value
thisdict["year"] = 2018