Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions exercicios/para-casa/ativ27.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
morango_kg = float(input('Quantos Kg de morango? '))
maca_kg = float(input('Quantos Kg de maçã? '))

if morango_kg <= 5:
preco_morango = 2.5
else:
preco_morango = 2.2

if maca_kg <= 5:
preco_maca = 1.8
else:
preco_maca = 1.5

total_kg = morango_kg + maca_kg
total_valor = (morango_kg * preco_morango) + (maca_kg * preco_maca)

if total_kg > 8 or total_valor > 25:
total_valor *= 0.9

print(f'O valor do morango é R$ {morango_kg * preco_morango:.2f}')
print(f'O valor da maçã é R$ {maca_kg * preco_maca:.2f}')
print(f'O valor a ser pago é R$ {total_valor:.2f}')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Código bonito, código bem feito e formoso

17 changes: 17 additions & 0 deletions exercicios/para-sala/funcoes/exemplos-math.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import math

print(math.log(10))
print(math.log(10, 2))
print(math.sin(25))
valor_de_pi = math.pi
#print(math.pi)
print(round(valor_de_pi, 2))
print(round(valor_de_pi))
print((3*valor_de_pi)/4)

numero_novo = 8.6
print(round(numero_novo))
print(type(round(numero_novo)))

#math.sin() -> seno
# #math.cos() -> cosseno
30 changes: 30 additions & 0 deletions exercicios/para-sala/funcoes/l.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
def calcular_media(n1, n2):
media_aluno = (n1 + n2)/2
return media_aluno

nota1 = 10
nota2 = 9

media_aluno = calcular_media(nota1, nota2)
print(media_aluno)

media_de_aprovacao = 5
media_de_recuperacao = 3

if type(media_aluno) == float:
media_aluno = round(media_aluno)

if media_aluno >= media_de_aprovacao:
if media_aluno > 9.5:
print("Aprovado com mérito")
else:
print("Aprovado")
elif media_aluno >= media_de_recuperacao:
print("Recuperação")
elif media_aluno >= 1:
print("Desclassificada")
else:
print("Reprovado")

print("Fim do programa")