Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 32b295c

Browse files
committed
Make "List construction" example in '02_Containers.md' executable.
1 parent 9c3e2e3 commit 32b295c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Notes/02_Working_with_data/02_Containers.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ An example when reading records from a file.
5252
records = [] # Initial empty list
5353

5454
with open('Data/portfolio.csv', 'rt') as f:
55+
next(f) # Skip header
5556
for line in f:
5657
row = line.split(',')
57-
records.append((row[0], int(row[1])), float(row[2]))
58+
records.append((row[0], int(row[1]), float(row[2])))
5859
```
5960

6061
### Dicts as a Container

0 commit comments

Comments
 (0)