Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Catalogue:
- def __init__(self, name: str):
- self.name = name
- self.products = []
- def add_product(self, product_name: str):
- self.products.append(product_name)
- def get_by_letter(self, first_letter: str):
- return [product for product in self.products if product.starts]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement