-->
当前位置:首页 > 题库

PROGRAMMING:JMU Python simple calculator

Luz5年前 (2021-05-10)题库389
Enter an expression string and calculate the result
###Input format:
-Line 1: enter the number of strings
-Next, enter the expressions to calculate
###Output format:
Output calculation results, the results retain 2 decimal places. For abnormal data, corresponding abnormal information can be output.
###Input sample 1:
```in
four
1+1
56-23
5/3
5*3.5
```
###Output sample 1:
```out
two
thirty-three
one point six seven
seventeen point five zero
```
###Input sample 2:
```in
three
ab+23
2/0
23+36f
```
###Output sample 2:
```out
NameError
ZeroDivisionError
SyntaxError
```







answer:If there is no answer, please comment