What Can You Do With Python and Counting Objects Using "Counter"
How is Python being used today, and what can you do with the language? Do you want to develop software, dive into data science and math, automate parts of your job and digital life, or work with electronics? This week on the show, David Amos is back, and he’s brought another batch of PyCoder’s Weekly articles and projects.
We talk about a Real Python article that covers the incredible variety of ways you can use Python. David shares an article about the pythonic way to count objects using the Counter class from the collections module. We discuss the ways it can lead to cleaner and more efficient code.
We cover several other articles and projects from the Python community including, the inaugural CPython developer-in-residence, typeclasses in Python, GitHub Copilot writes a text-based game, friendlier tracebacks in REPLs (including Jupyter), 120+ interactive interview challenges, a module that helps you build complex pipelines of batch jobs, and a tool for plotting in the terminal.
Course Spotlight: Understanding Python List Comprehensions
Python list comprehensions make it easy to create lists while performing sophisticated filtering, mapping, and conditional logic on their members. In this course, you’ll learn when to use a list comprehension in Python and how to create them effectively.
Topics:
Show Links:
Łukasz Langa Is the Inaugural CPython Developer-in-Residence
What Can I Do With Python? – You’ve finished a course or finally made it to the end of a book that teaches you the basics of programming with Python. You’ve learned about variables, lists, tuples, dictionaries, for and while loops, conditional statements, object-oriented concepts, and more. So, what’s next? What can you do with Python nowadays?
Typeclasses in Python – Sometimes you need to change the behavior of a function based on the type of argument passed to it. This is a classic example of polymorphism in programming. In this article, you’ll learn how this is typically done in Python, compare that to polymorphism in other languages, and see how the new classes library can make the whole process easier.
Copilot Writes a Text-Based Game in Python – GitHub’s new Copilot feature has a lot of people talking. The project’s goal is to be an AI pair programmer — a tool that can suggest entire lines of code or even entire functions! In this amusing article, one developer who gained access to Copilot’s technical preview shares how the AI wrote an entire text-based adventure game that turned out to be the solution to an exercise from a Python instructional book.
Python’s Counter: The Pythonic Way to Count Objects– In this step-by-step tutorial, you’ll learn how to use Python’s Counter to count several repeated objects at once. You’ll also learn how to use Counter objects to enhance other computations that you do in Python.
interactive-coding-challenges: 120+ Interactive Python Coding Interview Challenges With Anki Flashcards
Friendlier Tracebacks in REPLs (Including Jupyter) – Tracebacks are often the start of any Python debugging journey. But tracebacks can be difficult to read and confusing to beginners. The friendly-traceback project aims to lift the veil of confusion for tracebacks by providing more helpful error messages with lots of context. New updates to the project include better tracebacks in Jupyter Notebooks!
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Support the podcast & join our community of Pythonistas
Create your
podcast in
minutes
It is Free