class & dictionaries python example codes
Example 1: python dict access
my_dict = {'name':'Jack', 'age': 26}
my_dict['name']
Example 2: how to write a dict in pytohn
# get vs [] for retrieving elements
my_dict = {'name': 'Jack', 'age': 26}
# Output: Jack
print(my_dict['name'])
# Output: 26
print(my_dict.get('age'))