Skip to content

Commit c5872a1

Browse files
author
Calvin Gutierrez
committed
chal
1 parent 9437882 commit c5872a1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

days/04-06-collections/challenge.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ def get_movies_by_director(data=movie_csv):
1515
directors = defaultdict(list)
1616
with open(data, encoding='utf-8') as file:
1717
for line in csv.DictReader(file):
18-
pass
19-
20-
18+
try:
19+
director = line['director_name']
20+
title = line['movie_title'].replace('\xa0', '')
21+
year = int(line['title_year'])
22+
score = float(line['imdb_score'])
23+
except ValueError:
24+
continue
25+
m = Movie(title=title, year=year, score=score)
2126

2227

2328
# def calc_mean_score(movies):

0 commit comments

Comments
 (0)