Counters in Python Simply Explained

preview_player
Показать описание
In this video we learn how to use Counters in Python instead of dictionaries.

◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚

🌐 Social Media & Contact 🌐

Рекомендации по теме
Комментарии
Автор

You do a really solid job explaining the different methods and what they do. A lot of university teachers aren’t even that proactive when they teach. I like how you explain each part of the code. This is quality content.

numberiforgot
Автор

This guy is so underrated. Love your videos bro

gangahitesh
Автор

I always used dictionary for counting. Find counter existence only last week and here is you video

andrewkraevskii
Автор

Big 👍 like. Always a pleasure to watch your posts

ilanbar
Автор

why would you manually initialize a dictionary when you can use defaultdict(int)

lemonke
Автор

The counter already orders elements by most occurrences to least. No need to use most_common

ianbar
Автор

How would you count without using total()?

driedsquid
Автор

What programme are you using? My Python looks different. I'm so lost.

Colaghiro
Автор

continue codewars /clash of code please

tcgvsocg
Автор

This guy kind if looks like michael mando

jeffery_tang
Автор

I can't figure out what to type to get my last print result
thislist = ["apple", "banana", "cherry"]
x = input("Enter your item:")
thislist.insert(1, (x))
counter = Counter(thislist)
print (counter.most_common()[0])
message = input("Enter your item:")
if message == counter.most_common()[0]:
print("you win")

Press