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

Skip to content

Commit c8e0e80

Browse files
committed
report.py
1 parent 44df44e commit c8e0e80

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Work/report.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
# report.py
22
#
33
# Exercise 2.4
4+
import csv
5+
def read_portfolio(filename):
6+
portfolio = []
7+
with open(filename,'rt') as f:
8+
rows= csv.reader(f)
9+
headers = next(rows)
10+
for row in rows:
11+
holding = (row[0], int(row[1]), float(row[2]))
12+
portfolio.append(holding)
13+
return portfolio

0 commit comments

Comments
 (0)