Collections in Python
๐จ ๐๐จ๐ฅ๐ฅ๐๐๐ญ๐ข๐จ๐ง๐ฌ.๐๐จ๐ฎ๐ง๐ญ๐๐ซ: ๐๐จ๐ฎ๐ง๐ญ ๐ญ๐ก๐ ๐๐๐๐ฎ๐ซ๐ซ๐๐ง๐๐๐ฌ ๐จ๐ ๐๐ญ๐๐ฆ๐ฌ ๐ข๐ง ๐ ๐๐ข๐ฌ๐ญ
๐ฒ๏ธ If you want to count the occurrences of each item in a list, use collections.Counter. It takes one line of code to count using Counter. The code snippet below shows how it works.
๐ฒ๏ธ Not only is Counter shorter to write, but the execution time of Counter when working with a large list is also smaller compared to creating your own counter.s
youtube link for python playlist:
https://www.youtube.com/watch?v=-nitykYMYsc&list=PLfn1X0acn8m2kLEIb6N8m9RPp_WEXbBm6