-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcal.py
More file actions
34 lines (25 loc) · 756 Bytes
/
cal.py
File metadata and controls
34 lines (25 loc) · 756 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
26
27
28
29
30
31
32
def add(firstValue,secondValue):
result = firstValue+secondValue
print(result)
def sub(firstValue, secondValue):
result = firstValue-secondValue
print(result)
def mul(firstValue, secondValue):
result = firstValue*secondValue
print(result)
def div(firstValue,secondValue):
result = firstValue/secondValue
print(result)
operator = input("enter the operator:")
firstValue = int(input("enter the first values: "))
secondValue = int(input("enter the second value:"))
if operator=="+":
add(firstValue, secondValue)
elif operator == "-":
sub(firstValue, secondValue)
elif operator == "*":
mul(firstValue, secondValue)
elif operator == "/":
div(firstValue, secondValue)
else:
print("invalid operation")