Advertisement
Maxim_01

Untitled

Jul 2nd, 2022
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. class Catalogue:
  2.     def __init__(self, name: str):
  3.         self.name = name
  4.         self.products = []
  5.  
  6.     def add_product(self, product_name: str):
  7.         self.products.append(product_name)
  8.  
  9.     def get_by_letter(self, first_letter: str):
  10.         return [product for product in self.products if product.starts]
  11.  
  12.  
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement