python自带函数——浮点值 float()
提问人:杨紫红发布时间:2020-11-18
#带很多位小数的值
>>> 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
继续查找其他问题的答案?
相关视频回答
回复(0)
点击加载更多评论>>