diff --git a/exercicios/para-casa/ativ27.py b/exercicios/para-casa/ativ27.py new file mode 100644 index 0000000..eb0d6c3 --- /dev/null +++ b/exercicios/para-casa/ativ27.py @@ -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}') \ No newline at end of file diff --git a/exercicios/para-sala/funcoes/exemplos-math.py b/exercicios/para-sala/funcoes/exemplos-math.py new file mode 100644 index 0000000..ba845cc --- /dev/null +++ b/exercicios/para-sala/funcoes/exemplos-math.py @@ -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 diff --git a/exercicios/para-sala/funcoes/l.py b/exercicios/para-sala/funcoes/l.py new file mode 100644 index 0000000..ed642b0 --- /dev/null +++ b/exercicios/para-sala/funcoes/l.py @@ -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") +