Solution: Teach Your Code to Remember Lots of Things!
This program stores information about you in a dictionary and then prints each piece of information neatly.
The
medictionary holds data in key–value pairs.A key is like a label (e.g.,
"name").A value is the information that label points to (e.g.,
"Your Name").
me.items()returns all key–value pairs from the dictionary.The
forloop goes through each pair one by one, storing them inkeyandvalue.The
print()statement displays them in a readable format.
Solution: Teach Your Code to Remember Lots of Things!
This program stores information about you in a dictionary and then prints each piece of information neatly.
The
medictionary holds data in key–value pairs.A key is like a label (e.g.,
"name").A value is the information that label points to (e.g.,
"Your Name").
me.items()returns all key–value pairs from the dictionary.The
forloop goes through each pair one by one, storing them inkeyandvalue.The
print()statement displays them in a readable format.