How to convert tuple to float value in Python

1 Answer

0 votes
tpl = (3, 14) 
  
f = float('.'.join(str(item) for item in tpl)) 
  
print(f)

 
'''
run:
 
3.14
 
'''

 



answered Dec 20, 2019 by avibootz

Related questions

1 answer 155 views
1 answer 172 views
1 answer 122 views
1 answer 126 views
1 answer 122 views
...