joseleeph

Untitled

Nov 26th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. class student:
  2. def __init__(self, name, id):
  3. self.name = name
  4. self.id = id
  5. def changeID(self, id):
  6. self.id = id
  7.  
  8. def print(self):
  9. print("{} - {}".format(self.name, self.id))
  10.  
  11. print("creating a new student named Jane. Here is her info!")
  12. jane = student("Jane", 10)
  13. jane.print()
  14. jane.changeID(11)
  15. jane.print()
Advertisement
Add Comment
Please, Sign In to add comment