Sometimes, while working with a Python list, we can have a problem in which we need to find min/max value in the list. But sometimes, we don’t have a natural number but a floating-point number in string format. This problem can occur while working with data, both in web development and Data Science domain. Let’s discuss a way in which this problem can be solved.
Method : Using
min()/max() + float()
This problem can be solved using the
max function in which we first convert the strings into float and then pass this logic in functions in respective min/max function.
The original list is : ['4.5', '7.8', '9.8', '10.3'] The min value of list : 4.5 The max value of list : 10.3
- Convert String float to float list in Python
- Python - Summation of float string list
- Python | List of float to string conversion
- Python - Filter float strings from String list
- Python - Convert Float to digit list
- Python | Ways to sort list of float values
- Python | Check for float string
- Python | Convert List of String List to String List
- Python | Convert mixed data types tuple list to string list
- Python | Convert list of string to list of list
- Python | Convert string List to Nested Character List
- Python Program to convert List of Integer to List of String
- Python | Convert list of numerical string to list of Integers
- Python | Convert list of string into sorted list of integer
- Python | Convert a string representation of list into list
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.