In Python, there isn't a built-in "bag" data type like there is in some other programming languages. However, you can achieve similar functionality using the collections.Counter class, which is part of the collections module. A Counter is essentially a dictionary for counting hashable objects. Here's a brief overview of how you can use it:
from collections import Counter