Initial commit
This commit is contained in:
1 parent
82e815fab2
commit
7d4b30154a
259 files changed
+600233
-2
No files matched your search
@@ -0,0 +1,12 @@
|
||||
# pcost.py
|
||||
|
||||
total_cost = 0.0
|
||||
|
||||
with open('../../Data/portfolio.dat', 'r') as f:
|
||||
for line in f:
|
||||
fields = line.split()
|
||||
nshares = int(fields[1])
|
||||
price = float(fields[2])
|
||||
total_cost = total_cost + nshares * price
|
||||
|
||||
print(total_cost)
|
||||
Reference in new issue
Block a user