If I have a list of 5 random integers, is there a simple way to iterate through the list and see how many of each number there are without using 25 if/elif statements. For example my list might contain [3, 7, 10, 10, 14]. How would I determine that there are two 10's and only one of everything else. I am still learning Python and don't know some of the shortcuts yet. Thanks.
txwooley 0 Junior Poster in Training
woooee 814 Nearly a Posting Maven
txwooley 0 Junior Poster in Training
lllllIllIlllI 178 Veteran Poster
txwooley commented: Thanks. i'll try that out +1
txwooley 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.