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
- Python | Ways to sort list of float values
- Python | Check for float string
- Python | Convert list of string to list of list
- Python | Convert list of string into sorted list of integer
- Python | Convert list of numerical string to list of Integers
- Python | Convert string enclosed list to list
- Python | Convert a string representation of list into list
- Python | Check if given string can be formed by concatenating string elements of list
- Python | Check if string ends with any string in given list
- Python | First Non-Empty String in list
- Sum of list (with string types) in Python
- Python program to convert a list to string
- Python | Categorize the given list by string size
- Python | Splitting string to list of characters
- Python | Insert value after each k letters in given list of string
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.