知方号

知方号

What does float mean in python?<在python中float是什么意思>

Description

Number type: float(floating point)

Function: float()

The float() function is used to convert integers and strings into floating point numbers.

float() syntax:

class float([x])

Parameters:

x -- integer or string

Return value:

Return floating point number

Example:

>>>float(1)1.0>>> float(112)112.0>>> float(-123.6)-123.6>>> float('123') # 字符串123.0Copy after login

For more Python related technical articles, please visit the Python Tutorial column study!

The above is the detailed content of What does float mean in python?. For more information, please follow other related articles on the PHP Chinese website!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至lizi9903@foxmail.com举报,一经查实,本站将立刻删除。