In [110]: 5**(1/2)

Out[110]: 2.23606797749979


In [111]: import math


In [112]: math.sqrt(5)

Out[112]: 2.23606797749979


In [113]: dir(math)

Out[113]:

['__doc__',

'__loader__',

'__name__',

'__package__',

'__spec__',

'acos',

'acosh',

'asin',

'asinh',

'atan',

'atan2',

'atanh',

'ceil',

'copysign',

'cos',

'cosh',

'degrees',

'e',

'erf',

'erfc',

'exp',

'expm1',

'fabs',

'factorial',

'floor',

'fmod',

'frexp',

'fsum',

'gamma',

'gcd',

'hypot',

'inf',

'isclose',

'isfinite',

'isinf',

'isnan',

'ldexp',

'lgamma',

'log',

'log10',

'log1p',

'log2',

'modf',

'nan',

'pi',

'pow',

'radians',

'sin',

'sinh',

'sqrt',

'tan',

'tanh',

'trunc']


In [114]: import math


In [115]: math.cos(10)

Out[115]: -0.8390715290764524


In [116]: import math as m


In [117]: m.cos(10)

Out[117]: -0.8390715290764524


In [118]: from math import cos


In [119]: cos(10)

Out[119]: -0.8390715290764524


In [120]: from math import *


In [121]: cos(10)

Out[121]: -0.8390715290764524


In [122]: sin(10)

Out[122]: -0.5440211108893698


In [123]: tanh)

File "<ipython-input-123-d1885f8696cc>", line 1

tanh)

^

SyntaxError: invalid syntax



In [124]: tanh(10)

Out[124]: 0.9999999958776927


In [125]: dir()

Out[125]:

['In',

'Out',

'_',

'_101',

'_103',

'_105',

'_107',

'_108',

'_110',

'_112',

'_113',

'_115',

'_117',

'_119',

'_121',

'_122',

'_124',

'_66',

'_67',

'_68',

'_71',

'_75',

'_78',

'_79',

'_80',

'_91',

'_97',

'_99',

'__',

'___',

'__builtin__',

'__builtins__',

'__name__',

'_dh',

'_i',

'_i100',

'_i101',

'_i102',

'_i103',

'_i104',

'_i105',

'_i106',

'_i107',

'_i108',

'_i109',

'_i110',

'_i111',

'_i112',

'_i113',

'_i114',

'_i115',

'_i116',

'_i117',

'_i118',

'_i119',

'_i120',

'_i121',

'_i122',

'_i123',

'_i124',

'_i125',

'_i53',

'_i54',

'_i55',

'_i56',

'_i57',

'_i58',

'_i59',

'_i60',

'_i61',

'_i62',

'_i63',

'_i64',

'_i65',

'_i66',

'_i67',

'_i68',

'_i69',

'_i70',

'_i71',

'_i72',

'_i73',

'_i74',

'_i75',

'_i76',

'_i77',

'_i78',

'_i79',

'_i80',

'_i81',

'_i82',

'_i83',

'_i84',

'_i85',

'_i86',

'_i87',

'_i88',

'_i89',

'_i90',

'_i91',

'_i92',

'_i93',

'_i94',

'_i95',

'_i96',

'_i97',

'_i98',

'_i99',

'_ih',

'_ii',

'_iii',

'_oh',

'_sh',

'a',

'acos',

'acosh',

'asin',

'asinh',

'atan',

'atan2',

'atanh',

'b',

'ceil',

'comparator',

'copysign',

'cos',

'cosh',

'countchar',

'degrees',

'e',

'erf',

'erfc',

'exit',

'exp',

'expm1',

'fabs',

'factorial',

'floor',

'fmod',

'frexp',

'fsum',

'gamma',

'gcd',

'get_ipython',

'hypot',

'inf',

'isclose',

'isfinite',

'isinf',

'isnan',

'ldexp',

'lgamma',

'log',

'log10',

'log1p',

'log2',

'm',

'math',

'modf',

'nan',

'pi',

'pow',

'quit',

'radians',

'sin',

'sinh',

'sqrt',

'tan',

'tanh',

'trunc',

'x']


In [126]: %reset


Once deleted, variables cannot be recovered. Proceed (y/[n])? y


In [127]: dir()

Out[127]:

['In',

'Out',

'__builtin__',

'__builtins__',

'__name__',

'_dh',

'_i',

'_i127',

'_ih',

'_ii',

'_iii',

'_oh',

'_sh',

'exit',

'get_ipython',

'quit']


In [128]: from math import *


In [129]: dir()

Out[129]:

['In',

'Out',

'_',

'_127',

'__',

'___',

'__builtin__',

'__builtins__',

'__name__',

'_dh',

'_i',

'_i127',

'_i128',

'_i129',

'_ih',

'_ii',

'_iii',

'_oh',

'_sh',

'acos',

'acosh',

'asin',

'asinh',

'atan',

'atan2',

'atanh',

'ceil',

'copysign',

'cos',

'cosh',

'degrees',

'e',

'erf',

'erfc',

'exit',

'exp',

'expm1',

'fabs',

'factorial',

'floor',

'fmod',

'frexp',

'fsum',

'gamma',

'gcd',

'get_ipython',

'hypot',

'inf',

'isclose',

'isfinite',

'isinf',

'isnan',

'ldexp',

'lgamma',

'log',

'log10',

'log1p',

'log2',

'modf',

'nan',

'pi',

'pow',

'quit',

'radians',

'sin',

'sinh',

'sqrt',

'tan',

'tanh',

'trunc']


In [130]: import math as mymath


In [131]: mymath.cos(10)

Out[131]: -0.8390715290764524


In [132]: mymath.cos(mymath.pi)

Out[132]: -1.0


In [133]: mymath.pi

Out[133]: 3.141592653589793


In [134]: pi

Out[134]: 3.141592653589793


In [135]: %reset


Once deleted, variables cannot be recovered. Proceed (y/[n])? y


In [136]: pi

Traceback (most recent call last):


File "<ipython-input-136-68f7b1e53523>", line 1, in <module>

pi


NameError: name 'pi' is not defined



In [137]: from math import pi


In [138]: pi

Out[138]: 3.141592653589793


In [139]: %reset


Once deleted, variables cannot be recovered. Proceed (y/[n])? y


In [140]: dir()

Out[140]:

['In',

'Out',

'__builtin__',

'__builtins__',

'__name__',

'_dh',

'_i',

'_i140',

'_ih',

'_ii',

'_iii',

'_oh',

'_sh',

'exit',

'get_ipython',

'quit']


In [141]: from math import *


In [142]: dir()

Out[142]:

['In',

'Out',

'_',

'_140',

'__',

'___',

'__builtin__',

'__builtins__',

'__name__',

'_dh',

'_i',

'_i140',

'_i141',

'_i142',

'_ih',

'_ii',

'_iii',

'_oh',

'_sh',

'acos',

'acosh',

'asin',

'asinh',

'atan',

'atan2',

'atanh',

'ceil',

'copysign',

'cos',

'cosh',

'degrees',

'e',

'erf',

'erfc',

'exit',

'exp',

'expm1',

'fabs',

'factorial',

'floor',

'fmod',

'frexp',

'fsum',

'gamma',

'gcd',

'get_ipython',

'hypot',

'inf',

'isclose',

'isfinite',

'isinf',

'isnan',

'ldexp',

'lgamma',

'log',

'log10',

'log1p',

'log2',

'modf',

'nan',

'pi',

'pow',

'quit',

'radians',

'sin',

'sinh',

'sqrt',

'tan',

'tanh',

'trunc']


In [143]: