data examples announcements examples objects land owners
play

Data Examples Announcements Examples: Objects Land Owners - PowerPoint PPT Presentation

Data Examples Announcements Examples: Objects Land Owners Instance attributes are found before class attributes; class attributes are inherited 4 Land Owners Instance attributes are found before class attributes; class attributes are


  1. Data Examples

  2. Announcements

  3. Examples: Objects

  4. Land Owners Instance attributes are found before class attributes; class attributes are inherited 4

  5. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: 4

  6. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: greeting = 'Sir' 4

  7. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: greeting = 'Sir' def __init__(self): self.elf = Worker 4

  8. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: greeting = 'Sir' def __init__(self): self.elf = Worker def work(self): return self.greeting + ', I work' 4

  9. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: greeting = 'Sir' def __init__(self): self.elf = Worker def work(self): return self.greeting + ', I work' def __repr__(self): return Bourgeoisie.greeting 4

  10. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: greeting = 'Sir' def __init__(self): self.elf = Worker def work(self): return self.greeting + ', I work' def __repr__(self): return Bourgeoisie.greeting class Bourgeoisie(Worker): 4

  11. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: greeting = 'Sir' def __init__(self): self.elf = Worker def work(self): return self.greeting + ', I work' def __repr__(self): return Bourgeoisie.greeting class Bourgeoisie(Worker): greeting = 'Peon' 4

  12. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: greeting = 'Sir' def __init__(self): self.elf = Worker def work(self): return self.greeting + ', I work' def __repr__(self): return Bourgeoisie.greeting class Bourgeoisie(Worker): greeting = 'Peon' def work(self): print(Worker.work(self)) return 'I gather wealth' 4

  13. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: greeting = 'Sir' def __init__(self): self.elf = Worker def work(self): return self.greeting + ', I work' def __repr__(self): return Bourgeoisie.greeting class Bourgeoisie(Worker): greeting = 'Peon' def work(self): print(Worker.work(self)) return 'I gather wealth' jack = Worker() john = Bourgeoisie() jack.greeting = 'Maam' 4

  14. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: >>> Worker().work() greeting = 'Sir' def __init__(self): self.elf = Worker >>> jack def work(self): return self.greeting + ', I work' def __repr__(self): return Bourgeoisie.greeting >>> jack.work() class Bourgeoisie(Worker): greeting = 'Peon' >>> john.work() def work(self): print(Worker.work(self)) return 'I gather wealth' >>> john.elf.work(john) jack = Worker() john = Bourgeoisie() jack.greeting = 'Maam' 4

  15. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: <class Worker> >>> Worker().work() greeting = 'Sir' greeting: 'Sir' def __init__(self): self.elf = Worker >>> jack def work(self): return self.greeting + ', I work' def __repr__(self): return Bourgeoisie.greeting >>> jack.work() class Bourgeoisie(Worker): greeting = 'Peon' >>> john.work() def work(self): print(Worker.work(self)) return 'I gather wealth' >>> john.elf.work(john) jack = Worker() john = Bourgeoisie() jack.greeting = 'Maam' 4

  16. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: <class Worker> >>> Worker().work() greeting = 'Sir' greeting: 'Sir' def __init__(self): self.elf = Worker >>> jack def work(self): <class Bourgeoisie> return self.greeting + ', I work' def __repr__(self): greeting: 'Peon' return Bourgeoisie.greeting >>> jack.work() class Bourgeoisie(Worker): greeting = 'Peon' >>> john.work() def work(self): print(Worker.work(self)) return 'I gather wealth' >>> john.elf.work(john) jack = Worker() john = Bourgeoisie() jack.greeting = 'Maam' 4

  17. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: <class Worker> >>> Worker().work() greeting = 'Sir' greeting: 'Sir' def __init__(self): self.elf = Worker >>> jack def work(self): <class Bourgeoisie> return self.greeting + ', I work' def __repr__(self): greeting: 'Peon' return Bourgeoisie.greeting >>> jack.work() jack <Worker> class Bourgeoisie(Worker): greeting = 'Peon' >>> john.work() elf: def work(self): print(Worker.work(self)) return 'I gather wealth' >>> john.elf.work(john) jack = Worker() john = Bourgeoisie() jack.greeting = 'Maam' 4

  18. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: <class Worker> >>> Worker().work() greeting = 'Sir' greeting: 'Sir' def __init__(self): self.elf = Worker >>> jack def work(self): <class Bourgeoisie> return self.greeting + ', I work' def __repr__(self): greeting: 'Peon' return Bourgeoisie.greeting >>> jack.work() jack <Worker> class Bourgeoisie(Worker): greeting = 'Peon' >>> john.work() elf: def work(self): print(Worker.work(self)) return 'I gather wealth' john <Bourgeoisie> >>> john.elf.work(john) jack = Worker() elf: john = Bourgeoisie() jack.greeting = 'Maam' 4

  19. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: <class Worker> >>> Worker().work() greeting = 'Sir' greeting: 'Sir' def __init__(self): self.elf = Worker >>> jack def work(self): <class Bourgeoisie> return self.greeting + ', I work' def __repr__(self): greeting: 'Peon' return Bourgeoisie.greeting >>> jack.work() jack <Worker> class Bourgeoisie(Worker): greeting = 'Peon' >>> john.work() elf: def work(self): greeting: 'Maam' print(Worker.work(self)) return 'I gather wealth' john <Bourgeoisie> >>> john.elf.work(john) jack = Worker() elf: john = Bourgeoisie() jack.greeting = 'Maam' 4

  20. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: <class Worker> >>> Worker().work() >>> Worker().work() greeting = 'Sir' greeting: 'Sir' def __init__(self): self.elf = Worker >>> jack def work(self): <class Bourgeoisie> return self.greeting + ', I work' def __repr__(self): greeting: 'Peon' return Bourgeoisie.greeting >>> jack.work() jack <Worker> class Bourgeoisie(Worker): greeting = 'Peon' >>> john.work() elf: def work(self): greeting: 'Maam' print(Worker.work(self)) return 'I gather wealth' john <Bourgeoisie> >>> john.elf.work(john) jack = Worker() elf: john = Bourgeoisie() jack.greeting = 'Maam' 4

  21. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: <class Worker> >>> Worker().work() >>> Worker().work() greeting = 'Sir' 'Sir, I work' greeting: 'Sir' def __init__(self): self.elf = Worker >>> jack def work(self): <class Bourgeoisie> return self.greeting + ', I work' def __repr__(self): greeting: 'Peon' return Bourgeoisie.greeting >>> jack.work() jack <Worker> class Bourgeoisie(Worker): greeting = 'Peon' >>> john.work() elf: def work(self): greeting: 'Maam' print(Worker.work(self)) return 'I gather wealth' john <Bourgeoisie> >>> john.elf.work(john) jack = Worker() elf: john = Bourgeoisie() jack.greeting = 'Maam' 4

  22. Land Owners Instance attributes are found before class attributes; class attributes are inherited class Worker: <class Worker> >>> Worker().work() >>> Worker().work() greeting = 'Sir' 'Sir, I work' greeting: 'Sir' def __init__(self): self.elf = Worker >>> jack >>> jack def work(self): <class Bourgeoisie> return self.greeting + ', I work' def __repr__(self): greeting: 'Peon' return Bourgeoisie.greeting >>> jack.work() jack <Worker> class Bourgeoisie(Worker): greeting = 'Peon' >>> john.work() elf: def work(self): greeting: 'Maam' print(Worker.work(self)) return 'I gather wealth' john <Bourgeoisie> >>> john.elf.work(john) jack = Worker() elf: john = Bourgeoisie() jack.greeting = 'Maam' 4

Recommend


More recommend