Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. class Customer():
  2. def __init__(self, name, products):
  3. self.name = name
  4. self.products = products
  5.  
  6. def add_products(self, product, price):
  7. self.products.append(product)
  8. self.products.append(price)
  9.  
  10. def get_info(self):
  11. return self.products
  12.  
  13.  
  14.  
  15.  
  16. person = Customer("Alex", ["apple", 2.0, "chocolate", 5.3])
  17.  
  18. print(person.get_info())
  19. person.add_products("bread", 1.0)
  20. print(person.get_info())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement