Python - Getting Organized: Data Structure Choices - dictionary, key, empty list
Head First Python: A Learner’s Guide to the Fundamentals of Python Programming, A Brain-Friendly Guide、 Paul Barry(著)、 O’Reilly Mediaの Chapter 6.(Getting Organized: Data Structure Choices)、EXERCISE(312/682)の解答を求めてみる。
Jupyter(コード、入出力結果)
OrganizingData.ipynb
swimmers = {}
for swim_file in swim_files:
name = swimclub.read_swim_data(swim_file)[0]
swimmers[name] = []
swimmers
{'Hannah': [],
'Darius': [],
'Owen': [],
'Mike': [],
'Abi': [],
'Ruth': [],
'Tasmin': [],
'Erika': [],
'Maria': [],
'Elba': [],
'Ali': [],
'Chris': [],
'Aurora': [],
'Katie': [],
'Alison': [],
'Emma': [],
'Calvin': [],
'Blake': [],
'Bill': [],
'Dave': [],
'Lizzie': [],
'Carl': []}