http://www.skillbrew.com /SkillbrewTalent brewed by the industry itself Math Module Pavan Verma @YinYangPavan 1 Founder, P3 InfoTech Solutions Pvt. Ltd. Python Programming Essentials
© SkillBrew http://skillbrew.com Constants >>> import math >>> math.pi 3.141592653589793 >>> math.e 2.718281828459045 2
© SkillBrew http://skillbrew.com Functions (ceil and floor) >>> import math >>> math.ceil(3.14) 4.0 >>> math.floor(3.14) 3.0 3
© SkillBrew http://skillbrew.com Functions (2) >>> import math >>> math.factorial(5) 120 >>> math.pow(10, 3) 1000.0 >>> math.sqrt(10) 3.1622776601683795 4
© SkillBrew http://skillbrew.com Functions (3) >>> import math >>> math.log(100, 10) 2.0 >>> math.log(100) 4.605170185988092 >>> math.exp(4) #e**x 54.598150033144236 5 log(x, base) logarithm of x to the given base base is an optional argument by default base is e
© SkillBrew http://skillbrew.com Functions (4) >>> import math >>> math.radians(90) 1.5707963267948966 >>> math.degrees(1.5) 85.94366926962348 6 radians(x):Converts angle x from degrees to radians degrees(x): Converts angle x from radians to degrees
© SkillBrew http://skillbrew.com Summary  Constants  Functions – ceil, floor, factorial, power, sqrt, log, exp, radians, degrees 7
© SkillBrew http://skillbrew.com Resources  Math module documentation http://docs.python.org/2/library/math.html 8

Python Programming Essentials - M24 - math module