python自帶函數(shù)——整數(shù) int()
提問人:楊紫紅發(fā)布時(shí)間:2020-11-18
>>> int(123.456)
123
>>> int('123')
123
>>> int('123456')
Traceback (most recent call last):
File "<pyshell>", line 1, in <module>
int('123.456')
ValueError: invalid literal for int() with base 10: '123.456'
繼續(xù)查找其他問題的答案?
相關(guān)視頻回答
點(diǎn)擊加載更多評(píng)論>>