-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday1.py.py
More file actions
29 lines (29 loc) · 802 Bytes
/
day1.py.py
File metadata and controls
29 lines (29 loc) · 802 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
name , age = input("Please enter your name : ") , input("Please enter your age : ")
print(f"Your name is {name} and your age is {age}")
def sum(a , b):
return (a + b)
def subtract(a , b):
return(a - b)
def multiply(a , b):
return(a * b)
def division(a , b):
return(a / b)
def mod(a , b):
return(a % b)
num1 , num2 = int(input("Please enter number 1 : ")) , int(input("Please enter number 2 : "))
oper = input("Please enter operator : ")
if oper == "+":
print(sum(num1 , num2))
elif oper == "-":
print(subtract(num1 , num2))
elif oper == "*":
print(multiply(num1 , num2))
elif oper == "/":
if num2 != 0:
print(division(num1 , num2))
else:
print("Error")
elif oper == "%":
print(mod(num1 , num2))
else:
print("Please enter correct operator")