Back
Close

Simple Math Calculator

Statement

 Goal

You must figure out how to make a calculator given line spacing.


------------NOT REQUIRED----------------
? what will be displayed if 1/0 = ZeroDivisionError: division by zero
? what will be displayed if 1/3 = 0
? will it calculate -1 + -1 = -2
? will it calculate +1 - +2 = -1
? will it handle 1234567890123456789 * 99999.999999 = ValueError: invalid literal for int() with base 10...
? will it handle 1234567890123456789 x 99999.999999 =ValueError: invalid literal for int() with base 10...
? will it handle 0.00000000000000001 / 0.3 =ValueError: invalid literal for int() with base 10...
------------NOT REQUIRED----------------
Input
Each Line is either a number or a mathematical symbol.
+ = + addition
- = - subtraction
x = * multiplication
/ = / division
Output
One line of the answer
Constraints
Example
Input
8
-
3
Output
5

Game modes
Reverse

Test cases
Test 1 Test
Input
8 - 3
Output
5

Validator 1 Validator
Input
8 + 9238
Output
9246

Test 2 Test
Input
8 x 3
Output
24

Validator 2 Validator
Input
99 + 1
Output
100

Test 3 Test
Input
3 x 91
Output
273

Validator 3 Validator
Input
3 + 91
Output
94

Test 4 Test
Input
99 + 13
Output
112

Validator 4 Validator
Input
99 / 1
Output
99

Test 5 Test
Input
8 / 8
Output
1

Validator 5 Validator
Input
8 - 9
Output
-1

Test 6 Test
Input
3 x 3
Output
9

Validator 6 Validator
Input
98 / 2
Output
49

Test 7 Test
Input
3 x 1
Output
3

Validator 7 Validator
Input
4 x 2
Output
8

Solution language

Solution

Stub generator input