Quote:done it one way but the tool our class uses called 'Livelab' doesn't accept the codeI thought you couldnt use collections?
from collections import Counter a = [2, 5, 6, 5, 4, 3, 23, 43, 2] print(Counter(a))
Recommended Tutorials:
Quick Lists Question (Count Occurences)
|
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Count occurences in a string and add to a list using loops | Leyo | 4 | 1,777 |
Mar-11-2022, 03:52 PM Last Post: Leyo |
|
Calculator I need quick help | Malin3k | 3 | 2,154 |
Feb-13-2021, 02:10 AM Last Post: BashBedlam |
|
Count Letters in a Sentence (without using the Count Function) | bhill | 3 | 5,329 |
Jun-19-2018, 02:52 AM Last Post: bhill |
|
regex, counting occurences | yanhto | 4 | 3,464 |
May-06-2018, 10:20 PM Last Post: killerrex |