![]() |
| ||
| Numeric elements of a mixed list Right now I have a mixed list of different types of elements: mixed_list = [1, 0.5, 0, 3, 'a', 'z']How can I find the maximum numeric element of the list? |
| ||
| Re: Numeric elements of a mixed list The easiest way is to extablish a temporary list of numeric values ... mixed_list = [1, 0.5, 0, 3, 'a', 'z']You can shorten this with a list comprehension ... mixed_list = [1, 0.5, 0, 3, 'a', 'z'] |
| ||
| Re: Numeric elements of a mixed list Thank you Vega! |
| All times are GMT -4. The time now is 12:55 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC