📜  如何在 pytohn 中编写字典 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:19.597000             🧑  作者: Mango

代码示例1
# get vs [] for retrieving elements
my_dict = {'name': 'Jack', 'age': 26}

# Output: Jack
print(my_dict['name'])

# Output: 26
print(my_dict.get('age'))