Skip to content

Commit 46afa8c

Browse files
committed
improved q1 by replacing a list with a list generator
1 parent 2f3d05a commit 46afa8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

q2/matt/q2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def read_data():
1010

1111
data = []
1212
with open("../data.txt") as f:
13-
data = [line.strip().split(",") for line in f.readlines()]
13+
data = (line.strip().split(",") for line in f.readlines())
1414
return {name:{"weight":float(weight), "height":float(height)}
1515
for name, height, weight in data}
1616

0 commit comments

Comments
 (0)