x = min(2,3,4,5,6,7,8,9) # minimum Value will be store in variable x
x
2
y = max(2,3,4,5,6,7,8,9)
y
9
To calculate the square root of a number, you can use the sqrt() function from the Python math module/Library.
import math
math.sqrt(4)
2.0
math.sqrt(25)
5.0
In mathematics, the term "pow" is often used as an abbreviation for "power." 2^3 = 2 × 2 × 2 = 8.
pow(5,2) # 5*5
25
pow(4,3) #(4*4*4)
64
#Import math library
import math
#Round a number upward to its nearest integer
x = math.ceil(1.4)
print(x)
2
#Round a number downward to its nearest integer
y = math.floor(1.4)
print(y)
1