Aula07 - ex05 fixed

This commit is contained in:
tiagorg 2022-11-12 22:00:09 +00:00
parent 4e4512f6a8
commit 2eed0e4776
Signed by untrusted user who does not match committer: TiagoRG
GPG Key ID: DFCD48E3F420DB42
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,6 @@
# Fundamentos de Programação
## Aula 07 - [Slides](https://github.com/TiagoRG/uaveiro-leci/blob/master/1ano/fp/slides/tp07-dictionaries.pdf)
### Tópico principal da aula: Dictionaries
#### Exercícios em falta: ex05.d)
---
*Pode conter erros, caso encontre algum, crie um* [*ticket*](https://github.com/TiagoRG/uaveiro-leci/issues/new)

View File

@ -84,11 +84,12 @@ def stocksByDateByName(lst):
return dic
# Função não completa
def portfolioValue(stocks, portfolio, date):
assert date in stocks
val = 0.0
# Complete ...
for comp in portfolio:
val += portfolio[comp] * stocks[date][comp][CLOSE]
return val