Advertisement
DiYane

Storage

Sep 25th, 2023
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. class Storage:
  2.     storage = []
  3.     def __init__(self, capacity):
  4.         self.capacity = capacity
  5.  
  6.     def add_product(self, product: str):
  7.         if self.capacity > 0:
  8.             Storage.storage.append(product)
  9.             self.capacity -= 1
  10.  
  11.     def get_products(self):
  12.         return Storage.storage
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement