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

相關文章
相關標籤/搜索