Sichanov

customer

Mar 10th, 2022
956
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. class Customer:
  2.     id = 1
  3.  
  4.     def __init__(self, name, address, email):
  5.         self.name = name
  6.         self.address = address
  7.         self.email = email
  8.         self.id = Customer.id
  9.         Customer.id += 1
  10.  
  11.     @staticmethod
  12.     def get_next_id():
  13.         return Customer.id
  14.  
  15.     def __repr__(self):
  16.         return f"Customer <{self.id}> {self.name}; Address: {self.address}; Email: {self.email}"
Advertisement
Add Comment
Please, Sign In to add comment