Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

str to tuple of float

x = str((1, 20, 2.0))
 
y = tuple(float(s) for s in x.strip("()").split(","))
print(y)
(1.0, 20.0, 2.0)
 
PREVIOUS NEXT
Tagged: #str #tuple #float
ADD COMMENT
Topic
Name
6+7 =