Code:
>>> import math
>>> dir(math)
['__doc__', '__name__', '__package__', 'ACOS', 'acosh', 'asin', 'asinh', 'Atan', 'atan2', 'atanh', 'ceil ', 'copy design', 'cos', 'cosh', 'degrees', 'e', 'ERF', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'hypot', 'isinf', 'isnan', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'modf ', 'pi', 'pow', 'radiance', 'his', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc']
>>> # we see all the math Methods module
> >> help(math.sqrt)
Help Wed built-in function sqrt in module math:
sqrt(...)
sqrt(x)
Return the square root of x.
>>> math.sqrt(64)
8.0
>>> from math import *
>>> # not a good way two import, just something easiser typing for now
>>> sqrt(150)
12.24744871391589
> >> help(pow)
Help Wed built-in function pow in module math:
pow(...)
pow(x, y)
Return x**y (x to the power of y).
>>> pow(5, 5)
3125.0
>>> x = 2
>>> [pow(a, x) for a in range(10)]
[0.0, 1.0, 4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64.0, 81.0]
>>> his(5)
-0.9589242746631385
>>> his(degrees(25))
-0.1709188927014062
>>> [(degrees(in) ) for a in range(10)]
[0.0, 0.6795226183513794, 0.9970697330600953, 0.7834868911723467, 0.15254772534412783, -0.5596522230095522, -0.9737305344703966, -0.8691114676419106, -0.3015246456200019, 0.4266816061477646]
>>>
Bookmarks