We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44df44e commit c8e0e80Copy full SHA for c8e0e80
1 file changed
Work/report.py
@@ -1,3 +1,13 @@
1
# report.py
2
#
3
# 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