How to find the max value in a list of float strings with Python

1 Answer

0 votes
lst = ['4.53', '3.14', '1.24', '4.52', '2.98'] 
  
mx = max(float(fs) for fs in lst) 
  
print(mx) 


 
'''
run:

4.53
 
'''

 



answered Dec 20, 2019 by avibootz

Related questions

1 answer 198 views
1 answer 165 views
1 answer 161 views
1 answer 203 views
2 answers 164 views
...