Yes, There's A Module For THIS In Python #code #python #programming

preview_player
Показать описание
Yes, there's a module for this in Python #code #python #programming
Рекомендации по теме
Комментарии
Автор

Counter is really useful in certain cases and prevents overengineered for loops and dicts

EsquivadorDePala
Автор

Nobody's gonna talk about this word that Counter() returned...

CasualPythonCoder
Автор

Well crafted to get your counter to print out 'sexy' as its counted values 😊

BeenThrDunThat
Автор

c = {x:text.count(x) for x in text}
Print(c)

(this should work but dont quote me on this)

burndowntheworld
Автор

I can see uses in cryptography here, especially in breaking codes...

Axel-imsi
Автор

I think this is intended :

from collections import Counter
text =
c = Counter(text)
# print(c)
print("".join([x for x in c])) # intended

prakash-niroula
Автор

Quite cool. I always forget these powerful tools...

darrenlefcoe
Автор

The counter looks like a math thing, the multi set. Does the counter object allow set operations. If not:

class(Counter):


Is going in my lib

DrDeuteron
Автор

One thing I have never really understood is where do you find all of these modules? I mean I can create my own and there are some basic examples I can find but where can I find a list of modules I can import?

paulosullivan
Автор

Of course there is lol. This would have been useful when I built a python program to tell me the best starting words for wordle last year. That was really one of my first projects I came up with on my own.

arthur_p_dent
Автор

What is the font you are using? I love it!

merakli
Автор

If it is a std module ok. If not, consider the impact of having extra dependencies if you are managing an application

motbus
Автор

You don't know JavaScript if you say there's a module for everything in Python

mke
Автор

can you even call it coding at this point? libraries are supposed to help with complex tasks, not counting letters.

quantdev
Автор

There is probably 😂
Then why most of my work requires me to spend hours still coding custom codes 😢

savire.ergheiz
Автор

Importing a module instead of writing a simple dict comprehension. Really nice example of how not to do in Python

alexeyzhurov
Автор

In interview, we dhould not use any builtin, we gave to write logic

raghavendraam
Автор

well, that's just made about 50% of my last 3 years work pointless.

transientaardvark
Автор

This is why Python is looked down upon. You have a loads of useless functions and modules

comrade_marshal