使用 get
方法打印 car
字典的“model”键的值。
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
print(@(16))
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
print(car.get("model"))
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
print(car.get('model'))