In [1]:
# Let's import the math module from the Python standard library
import math
In [2]:
# what can we do with math? use the dir() function to investigate
dir(math)
Out[2]:
In [3]:
# let's supose I want to use factorial... how do I get help?
help(math.factorial)
In [4]:
# okay let's try it:
math.factorial(5)
Out[4]:
In [5]:
# how about another one?
help(math.gcd)
In [6]:
# trying it out
result = math.gcd(24,32)
print (result)
In [ ]:
In [ ]: