Skip to content

Commit 7fbc374

Browse files
Add files via upload
1 parent 3c2f846 commit 7fbc374

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

1-CalcPy/calc.exe

5.65 MB
Binary file not shown.

1-CalcPy/calc.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#Calculadora Básica utilizando python
2+
3+
import os
4+
5+
x = int(input('Digite um operando: '))
6+
7+
y = int(input('\nDigite outro operando: '))
8+
9+
opr = input('\nEscolha um operador: \n\n+ Adição \n- Subtração' +
10+
'\nx Multiplicação \n/ Divisão \nP Potência\n')
11+
12+
match opr:
13+
case "+":
14+
print('\n' + str(x) + ' + ' + str(y) + ' = ' + str(x + y))
15+
case "-":
16+
print('\n' + str(x) + ' - ' + str(y) + ' = ' + str(x - y))
17+
case "X":
18+
print('\n' + str(x) + ' X ' + str(y) + ' = ' + str(x * y))
19+
case "x":
20+
print('\n' + str(x) + ' X ' + str(y) + ' = ' + str(x * y))
21+
case "/":
22+
print('\n' + str(x) + ' / ' + str(y) + ' = ' + str(x / y))
23+
case "P":
24+
print('\n' + str(x) + ' ^ ' + str(y) + ' = ' + str(pow(x, y)))
25+
case "p":
26+
print('\n' + str(x) + ' ^ ' + str(y) + ' = ' + str(pow(x, y)))
27+
case _:
28+
print('\nValor Inválido!')
29+
30+
os.system("pause")

1-CalcPy/readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Descrição
2+
3+
Calculadora básica utilizando a Linguagem Python.

0 commit comments

Comments
 (0)