MATLABユーザーのためのPython
Justin Kiggins
Product Manager
type(definitions)
dict
print(definitions['aardvark'])
夜行性で穴を掘る哺乳類。長い耳と筒状の鼻、長い伸縮舌を持ち、
アリやシロアリを食べる。アードバークはアフリカ原産で、近縁種はほぼいない。
# Create a dictionary
dog = {'name': 'Toby', 'breed': 'Basset Hound'}
# Add more key:value pairs
dog['weight (lbs)'] = 552.3
dog['birthdate'] = "2016-06-26"
print(dog)
{'name': 'Toby',
'breed': 'Basset Hound',
'weight (lbs)': 552.3,
'birthdate': '2016-06-26'}
# Update weight value dog['weight (lbs)'] = 52.3print(dog)
{'name': 'Toby',
'breed': 'Basset Hound',
'weight (lbs)': 52.3,
'birthdate': '2016-06-26'}
dog.pop('birthdate')
print(dog)
{'name': 'Toby',
'breed': 'Basset Hound',
'weight (lbs)': 52.3}
MATLABユーザーのためのPython