python 断言,round函数

##python 断言python

>>> assert 1 == 2, 'aaaaaaaaa'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AssertionError: aaaaaaaaa

>>>assert isinstance(1, int), 'aaaaaaaaaaaaaa'

###round() >>> round(2, 2) 2.0 >>> round(2.9999, 2) 3.0 >>> round(2.00, 2) 2.0 >>> round(2.12, 2) 2.12 >>> round(2.12111, 2) 2.12 >>> round(2.1111, 2) 2.11code

相关文章
相关标签/搜索