Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

projeto guiado I - Jardielen Chaves #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chaves08r
Copy link

Pojeto guiado da semana 5.


dataset.append(novo_registro)

print(dataset)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as vezes isso pode poluir muito e deixar o usuário confuso, imagine se tiver 1 milhao de linhas

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

entendi, obrigada pelo feedback

def mostrar_receita():
mes_receita = input("Digite o mês da receita correspondente: ")
valor_total = 0
maior_receita = float('inf')*(-1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pode explicar o uso do float('inf') * -1 ? porquê utilizou dessa forma?

Copy link
Author

@chaves08r chaves08r May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Havia um ano em que apresentava duas receitas negativas e não aparecia a "maior" receita daquele ano, entao coloquei um infinito negativo para solucionar essa problematica... multiplicando inf por -1 me ajudou a criar uma referência para o menor valor.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

não sei se entendi. Se a receita me da valores negativos em alguns momentos e eu estou comparando com valor > valor_negativo mesmo que eu esteja comparando entre numeros negativos isso ainda seria uma verdade. Não? 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

esse arquivo eu adicionei errado :(

ano_menor_receita = 0

for el in dataset:
mes_el = el.get("mes_receita")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tem certeza que queremos o mês?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants