a=12
b=5
print(a+b) # 17 , sum of two numbers
print(a-b) # 7 , subtraction of two numbers
print(a*b) # 60, product of two numbers
print(a/b) # 2.4, quotient of two numbers
print(a//b) # 2 , floored quotient
print(a%b) # 2, remainder of division
print(a**b) # 248832, a to the power b
print(pow(a,b)) # 248832, a to the power b
print(divmod(a,b)) # (2,2) ,the pair (a // b, a % b)
Importing Math library
You may get error saying about the missing math library need to be included before using these functions.
math.pi π=3.141592 math.ee=2.718281 math.inf floating-point positive infinity, -math.inf is floating point negative infinity math.nan A floating point not a number.