-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalcu.py
62 lines (51 loc) · 1.29 KB
/
Calcu.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Calculadora 07 Febrero 2018
print('Diana Laura Vega Soto')
print('CALCULADORA')
print('Elige una opcion')
print('1.-Suma')
print('2.-Resta')
print('3.-Multiplicacion')
print('4.-Division')
print('5.-Potencia')
print('6.-Salir')
a = input('Escribe tu eleccion:')
b = float(a)
if (b==1):
x =input('Introduce un numero\n')
y =input('Introduce otro numero\n')
x2=float(x)
y2=float(y)
res= x2+y2
print('El resultado de la suma es:', res)
elif(b==2):
x =input('Introduce un numero\n')
y =input('Introduce otro numero\n')
x2=float(x)
y2=float(y)
res= x2-y2
print('El resultado de la resta es:', res)
elif(b==3):
x =input('Introduce un numero\n')
y =input('Introduce otro numero\n')
x2=float(x)
y2=float(y)
res= x2*y2
print('El resultado de la Multiplicacion es:', res)
elif(b==4):
x =input('Introduce un numero\n')
y =input('Introduce otro numero\n')
x2=float(x)
y2=float(y)
res= x2/y2
print('El resultado de la division es:', res)
elif(b==5):
x =input('Introduce un numero\n')
y =input('Introduce el valor de la potencia\n')
x2=float(x)
y2=float(y)
res= x2**y2
print('El resultado es:', res)
elif(b==6):
print('Adios')
else:
print('Numero Invalido')