-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelishteinma.py
More file actions
31 lines (23 loc) · 799 Bytes
/
elishteinma.py
File metadata and controls
31 lines (23 loc) · 799 Bytes
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
from eli import *
from izak import *
from matanya import *
def calculator():
action = input()
if '*' in action and not '**' in action:
action = action.split('*')
return mul(float(action[0]) , float(action[1]))
elif '/' in action:
action = action.split('/')
return div(float(action[0]), float(action[1]))
elif '+' in action:
action = action.split('+')
return add(float(action[0]), float(action[1]))
elif '-' in action:
action = action.split('-')
return sub(float(action[0]), float(action[1]))
elif 'r' in action:
action = action.split('r')
return sqrt(float(action[0]))
elif '**' in action:
action = action.split('**')
return power(float(action[0]), float(action[1]))