EN
Python - convert string to double
0 points
Unfortunately, there are no doubles in Python. You can use float that behaves like a double as an alternative solution.
Quick solution:
xxxxxxxxxx
1
number = "1.234"
2
result = float(number)
3
4
print(type(result)) # <class 'float'>
or:
xxxxxxxxxx
1
from decimal import Decimal
2
3
number = "1.234"
4
result = Decimal(number)
5
6
print(type(result)) # <class 'decimal.Decimal'>