From 2eed0e477620d786b4c4a8a9fe7f0cb1c17f077b Mon Sep 17 00:00:00 2001 From: tiagorg Date: Sat, 12 Nov 2022 22:00:09 +0000 Subject: [PATCH] Aula07 - ex05 fixed --- 1ano/fp/aula07/README.md | 1 - 1ano/fp/aula07/stocks.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/1ano/fp/aula07/README.md b/1ano/fp/aula07/README.md index 58a892a..d476f88 100644 --- a/1ano/fp/aula07/README.md +++ b/1ano/fp/aula07/README.md @@ -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) diff --git a/1ano/fp/aula07/stocks.py b/1ano/fp/aula07/stocks.py index 8f74fa3..3b35f12 100755 --- a/1ano/fp/aula07/stocks.py +++ b/1ano/fp/aula07/stocks.py @@ -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