Class 15 Math Module
Class 15 Math Module
print(dir(math))
ex:-
print(math.pi) # 3.141592653589793
print(math.sqrt(16)) # 4.0
print(math.pow(3,2)) # 9.0
Alias:-
emport math as m
once we create alias name,by using that we can access function and variable of that
module.
emport math as m
print(m.pi)gj
print(m.sqrt(25))ghj
print(m.sin(30))hj
cell(x)
floor(x)
pow(x,y)
factorial(x)
trunc(x)
gcd(x,y)
sin(x)
cos(x)
tan(x)
ans:-
from math import pi
r = 16
print('area of circle is:',pi*r**2)