Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Customer():
- def __init__(self, name, products):
- self.name = name
- self.products = products
- def add_products(self, product, price):
- self.products.append(product)
- self.products.append(price)
- def get_info(self):
- return self.products
- person = Customer("Alex", ["apple", 2.0, "chocolate", 5.3])
- print(person.get_info())
- person.add_products("bread", 1.0)
- print(person.get_info())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement