Cast value to floating-point number.
Syntax
float(value, /)Parameters
| Name | Description |
|---|---|
valueInt | Float | Boolean | String | Value to cast Required · Positional only No default |
Returns
Float — Converted floating-point value.Example
score = float("0.85")
if score > 0.8:
text("ok")