From 52dc18d7f3a5c4e79785ceb189ccf5196ba320a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Thu, 27 Oct 2022 20:09:20 -0300 Subject: [PATCH] =?UTF-8?q?Restart=20exerc=C3=ADcio=20guiado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula39.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/aula39.py b/aula39.py index 280fb4c..2b23c9c 100644 --- a/aula39.py +++ b/aula39.py @@ -1,32 +1,3 @@ """ Crie uma calculadora com while """ -while True: - numero_1 = input('Digite um número: ') - numero_2 = input('Digite o outro número: ') - operador = input('Digite um operador: ') - - numeros_sao_validos = None - numero_1_float = 0 - numero_2_float = 0 - - try: - numero_1_float = float(numero_1) - numero_2_float = float(numero_2) - numeros_sao_validos = True - except: - numeros_sao_validos = None - - operadores_permitidos = '+-/*' - - if operador not in operadores_permitidos: - print('Operador não é válido') - continue - - if operador == '+': - print(f'Resultado = {numero_1_float + numero_2_float}') - - quer_sair = input('Quer [s]air? ').lower().startswith('s') - - if quer_sair: - break