Python float() 組み込み関数

From the Python 3 documentation

数値または文字列 x から浮動小数点数を返します。

Introduction

Python の float() 関数は、数値または数を含む文字列を浮動小数点数に変換するための組み込み関数です。これは、小数点の精度を必要とする算術演算を実行する場合に特に役立ちます。

float() 関数は、数値または文字列から浮動小数点数を返します。

Examples

float('10')
float(10)
10.0
10.0
Morty Proxy This is a proxified and sanitized view of the page, visit original site.