Python standard library

This article is used to record standard class libraries in Python. The contents of this article are updated at any time.

math(Mathematical operations):

>>> import math
>>> math.pi
3.141592653589793
>>> math.ceil(5.2)
6
>>> math.floor(9.9)
9
>>> math.pow(4, 2)
16.0
>>> math.sqrt(9)
3.0
>>> math.fabs(-2)
2.0
>>> math.fmod(5, 3)
2.0

 

Leave a Reply

Your email address will not be published. Required fields are marked *