-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path15-condicao.py
More file actions
32 lines (28 loc) · 996 Bytes
/
15-condicao.py
File metadata and controls
32 lines (28 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Informações sobre o filme
# name = input("Digite o nome do filme:\n")
# yearRelease = int(input("Digite o ano de lançamento:\n"))
# rating = float(input("Digite a nota de avaliação do filme:\n"))
# # Verifica se o filme é recomendado
# if rating > 8.0 and yearRelease > 2015:
# print(f"O filme {name} é muito bom. Recomendo assisti-lo.")
# else:
# print(f"O filme {name} ainda não atingiu uma boa nota.")
num1 = float(input("Digite o primeiro número:\n"))
num2 = float(input("Digite o segundo número:\n"))
operation = input("Digite a operação a ser realizada: (+ - * /)\n")
if operation == "+":
result = num1 + num2
elif operation == "-":
result = num1 - num2
elif operation == "*":
result = num1 * num2
elif operation == "/":
if num2 != 0:
result = num1 / num2
else:
print("Erro: Divisão por Zero")
result = 0
else:
print("Operação inválida")
result = 0
print(f"Resultado da operação é: {result:.2f}")