Iniciar sesión Crear cuenta # Código de Python - Calculadora de números enteros en python 3 ## Calculadora de números enteros en python 3 ### Python

758 visualizaciones desde el 7 de Octubre del 2019
Simple calculadora de números enteros en Python 3 #### 20180702

759 visualizaciones desde el 7 de Octubre del 2019               Forma parte de Como Fazer um Programa de Calculadora Simples no Python 3

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
`def calculate():`
`    operation = input('''`
```Please type in the math operation you would like to complete:
```
```+ for addition
```
```- for subtraction
```
```* for multiplication
```
```/ for division
```
`''')`
` `
`    number_1 = int(input('Please enter the first number: '))`
`    number_2 = int(input('Please enter the second number: '))`
` `
`    if operation == '+':`
`        print('{} + {} ='.format(number_1, number_2), end=" ")`
`        print(number_1 + number_2)`
` `
`    elif operation == '-':`
`        print('{} - {} ='.format(number_1, number_2), end=" ")`
`        print(number_1 - number_2)`
` `
`    elif operation == '*':`
`        print('{} * {} ='.format(number_1, number_2), end=" ")`
`        print(number_1 * number_2)`
` `
`    elif operation == '/':`
`        print('{} / {} ='.format(number_1, number_2), end=" ")`
`        print(number_1 / number_2)`
` `
`    else:`
`        print('You have not typed a valid operator, please run the program again.')`
` `
`    again()`
` `
`def again():`
`    calc_again = input('''`
```Do you want to calculate again?
```
```Please type Y for YES or N for NO.
```
`''')`
` `
`    if calc_again.upper() == 'Y':`
`        calculate()`
`    elif calc_again.upper() == 'N':`
`        print('See you later.')`
`    else:`
`        again()`
` `
`calculate()`

### Comentarios sobre la versión: 20180702 (0)

No hay comentarios

### Comentar la versión: 20180702

 Nombre Correo (no se visualiza en la web) Valoración
Comentarios
Es necesario revisar y aceptar las políticas de privacidad