Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. # Classes
  2.  
  3. # A class is a description of
  4. # A new type object
  5.  
  6. # Classes have attributes (variable)
  7. # and methods (functions)
  8.  
  9. # Always give class names a
  10. # capital letter
  11.  
  12. class Employee:
  13.  
  14. # Initialization method
  15. def __init__(self,
  16. name,
  17. age,
  18. ID,
  19. position):
  20. self.name = name
  21. self.age = age
  22. self.ID = ID
  23. self.pos = position
  24.  
  25. def __str__(self):
  26. return self.name + "is a " + self.pos + "ID #" + str(self.ID_)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement