Let's say that I have a class "shoppingCart". I add items to the shopping cart: eggs, milk, cheese, bread, toothbrush, bacon, dish soap, potato chips, and bottled water.
class shoppingCart(object):
    def __init__(self):
        self.eggs = 12
        self.milk = 2
        self.cheese = 1
        self.bread = 0
        self.toothbrush = 1
        self.bacon = 10
        self.soap = 1
        self.chips = 2
        self.bottlewater = 24
myCart = shoppingCart()
Is it possible to create a group within the class, so that I could identify the number of items in my cart that fall into a specific category? For example, if I wanted to call all the attributes that are beverages (milk, water), or all the things that are non-food (toothbrush, soap), or things that are delicious (cheese, bacon, chips) - how could I go about doing that?