What does float mean in python?

Release: 2020-07-10 17:28:51
Original
95729 people have browsed it

What does float mean in python?

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.0
Copy 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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template