-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheighteen.py
24 lines (21 loc) · 932 Bytes
/
eighteen.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
user_input = int(input('hpw many test cases : '))
for i in range(user_input):
operation = input('please enter operation string')
operation_list = operation.split()
print(operation_list)
if operation_list[0] == 'add':
first_number = int(operation_list[1])
second_number = int(operation_list[2])
print(first_number + second_number)
elif operation_list[0] == 'sub':
first_number = int(operation_list[1])
second_number = int(operation_list[2])
print(first_number - second_number)
elif operation_list[0] == 'mul':
first_number = int(operation_list[1])
second_number = int(operation_list[2])
print(first_number * second_number)
elif operation_list[0] == 'div':
first_number = int(operation_list[1])
second_number = int(operation_list[2])
print(first_number / second_number)