Arithmetic operations in Python

Source code :

def add(a,b):
	return a+b
def sub(a,b):
	return a-b
def mul(a,b):
	return a*b
def div(a,b):
	return a/b
def mod(a,b):
	return a%b

print(add(1,2))
print(sub(1,2))
print(mul(1,2))
print(div(1,2))
print(mod(22,5))

Output :

3
-1
2
0.5
2

Output :


                

Comments :