python自帶函數(shù)——浮點(diǎn)值 float()
提問(wèn)人:楊紫紅發(fā)布時(shí)間:2020-11-18
#帶很多位小數(shù)的值
>>> print(abs(10))
10
>>> float('123.456789')
123.456789
>>> your_age = input('Enter your age: ')
Enter your age: 20
>>> age = float(your_age)
>>> if age > 13:
print('You are %s years too old' % (age - 13))
You are 7.0 years too old
繼續(xù)查找其他問(wèn)題的答案?
相關(guān)視頻回答
點(diǎn)擊加載更多評(píng)論>>