From 13a77161f71b4a95f0b5012fea9ff4e5de05ca06 Mon Sep 17 00:00:00 2001 From: cintiaaguiar Date: Thu, 24 Aug 2023 19:17:39 -0300 Subject: [PATCH] subindo exercicio da semana 3 --- Exercicio27.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Exercicio27.py diff --git a/Exercicio27.py b/Exercicio27.py new file mode 100644 index 0000000..2cbbc80 --- /dev/null +++ b/Exercicio27.py @@ -0,0 +1,23 @@ +morangos_kg = 10 +macas_kg = 10 + +preco_morango = 0 +preco_maca = 0 + +if morangos_kg <= 5: + preco_morango = morangos_kg * 2.50 +else: + preco_morango = morangos_kg * 2.20 + +if macas_kg <= 5: + preco_maca = macas_kg * 1.80 +else: + preco_maca = macas_kg * 1.50 + +preco_total = preco_morango + preco_maca + +if (morangos_kg + macas_kg) > 8 or preco_total > 25: + desconto = preco_total * 0.1 + preco_total -= desconto + +print(f"Valor total a ser pago: R$ {preco_total:.2f}") \ No newline at end of file