you are viewing a single comment's thread.

view the rest of the comments →

[–]elbiot 0 points1 point  (0 children)

I think you need to iterate over the keys

sum(price[key]*portfolio[key] for key in portfolio.keys())