![]() |
| ||
| List operation problem Greetings. I'm a python noob and I'm stuck with some coding. Say you have a list with a number of elements, some of which are the same. For instance: mylist = ['blue', 'red', 'green', 'green', 'red', 'red'] Is there a way to return how many times each string occurs in the list? |
| ||
| Re: List operation problem Yes there is it's pretty simple too mylist = ['blue', 'red', 'green', 'green', 'red', 'red'] Hope that helps. Chris |
| ||
| Re: List operation problem Awesome, thank you Chris! |
| All times are GMT -4. The time now is 1:01 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC