File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed
Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #Calculadora Básica utilizando python
2+
3+ import os
4+
5+ x = int (input ('Digite um operando: ' ))
6+
7+ y = int (input ('\n Digite outro operando: ' ))
8+
9+ opr = input ('\n Escolha um operador: \n \n + Adição \n - Subtração' +
10+ '\n x Multiplicação \n / Divisão \n P 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 ('\n Valor Inválido!' )
29+
30+ os .system ("pause" )
Original file line number Diff line number Diff line change 1+ # Descrição
2+
3+ Calculadora básica utilizando a Linguagem Python.
You can’t perform that action at this time.
0 commit comments