Created
March 26, 2013 12:24
-
-
Save timtan/5244993 to your computer and use it in GitHub Desktop.
normal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'tim' | |
fruits = [ | |
'apple', 'pineapple', | |
'apple', 'pineapple', | |
'apple', 'pineapple', | |
] | |
counter = {} | |
for fruit in fruits: | |
if fruit in counter: | |
counter[fruit] +=1 | |
else: | |
counter = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment