Python provides a module full of useful math functions. The documentation is at https://docs.python.org/3/library/math.html.
Below is some example code I ran in Jupyter Notebook.
1 | print (math.sqrt( 5 )) |
2 | print (math.pi) |
3 | print (math.factorial( int ( 5.0 ))) # must be an integer otherwise error) |
4 | print (math.factorial(math.floor( 5.6 ))) |
1 | 2.23606797749979 |
2 | 3.141592653589793 |
3 | 120 |
4 | 120 |