This commit is contained in:
Mike Bloy 2023-08-09 16:59:22 -05:00
parent a0c6bc139e
commit 784349ec36

17
pcost.py Normal file
View File

@ -0,0 +1,17 @@
from decimal import Decimal
def run(filename: str) -> Decimal:
with open(filename, 'r') as lines:
total = Decimal(0.0)
_, count, price = lines.readline().split()
count = Decimal(count)
price = Decimal(price)
total += count * price
return total
if __name__ == '__main__':
filename = 'Data/portfolio.dat'
value = run(filename)
print(f"value = {value}")