Isnt the Counter class really a dictionary with a custom add item protocol defined? (Newb question sorry if its not accurate).. it kind of is right? I forgot multisets exist...
Thanks again. I didn't know about Counters or frozen sets. Really useful stuff! Would be cool to see you making small rpg type game with all these neat Python tricks. I would enjoy watching like a 1 hour video of it.
Is there a compelling reason to use a Counter over a vanilla dictionary other than convenience/syntactical sugar? That .update() function is pretty slick
As a general question. What would be the pythonic way to express the following: journal_data.append(user_input(cmd)) or... journal_entry = user_input(cmd) journal_data.append(journal_entry)
There's no pythonic way in this but just a design preference. What I would suggest is go for second way as it looks much cleaner that way and you can use that variable at multiple places without repeating your code again and again.
This is channel is really great 👍
Your tutorials are really like the channel s name .. this one is real python
Thanks Dan, I recently learnt about this from the docs. Great explanation.
Excellent video.
Isnt the Counter class really a dictionary with a custom add item protocol defined? (Newb question sorry if its not accurate).. it kind of is right? I forgot multisets exist...
Thanks again. I didn't know about Counters or frozen sets. Really useful stuff! Would be cool to see you making small rpg type game with all these neat Python tricks. I would enjoy watching like a 1 hour video of it.
Wonderful explanation but add time stamps for targeted navigation for viewers
You hve not added link to 'what is hashable' that ccanbe added to sets.. Also can you state what is data structure in simple terms?
Dude which ide are you using?
Is there a compelling reason to use a Counter over a vanilla dictionary other than convenience/syntactical sugar? That .update() function is pretty slick
Is a frozenset the same as a tuple?
As a general question. What would be the pythonic way to express the following:
journal_data.append(user_input(cmd))
or...
journal_entry = user_input(cmd)
journal_data.append(journal_entry)
There's no pythonic way in this but just a design preference.
What I would suggest is go for second way as it looks much cleaner that way and you can use that variable at multiple places without repeating your code again and again.
Quick question: Isn't Multi-Bags example a 'dict' type, and not 'set()' ?
great video
what font is this?
Hey Dan!
Is there a way to have lists on a set besides getting a tuple version of those lists and append it to the set?
Is this IDLE or something else? Because I love its theme!
Dan Bader 😭😭 I'm on Windows
Well I used to call Counter or multiset a freq_dist
Is this how websites store user accounts? Seems like it can in a way.