Learn Python the Hard Way: A Very Simple Introduction to the Terrifyingly Beautiful World of Computers and Code, Third Edition (Jason Arnold's Library) by Zed A. Shaw
Author:Zed A. Shaw
Language: eng
Format: epub
Publisher: Addison-Wesley Professional
Published: 2014-03-25T16:00:00+00:00
* * *
1 ## Animal is-a object (yes, sort of confusing) look at the extra credit
2 class Animal(object):
3 pass
4
5 ## ??
6 class Dog(Animal):
7
8 def __init__(self, name):
9 ## ??
10 self.name = name
11
12 ## ??
13 class Cat(Animal):
14
15 def __init__(self, name):
16 ## ??
17 self.name = name
18
19 ## ??
20 class Person(object):
21
22 def __init__(self, name):
23 ## ??
24 self.name = name
25
26 ## Person has-a pet of some kind
27 self.pet = None
28
29 ## ??
30 class Employee(Person):
31
32 def __init__(self, name, salary):
33 ## ?? hmm what is this strange magic?
34 super(Employee, self).__init__(name)
35 ## ??
36 self.salary = salary
37
38 ## ??
39 class Fish(object):
40 pass
41
42 ## ??
43 class Salmon(Fish):
44 pass
45
46 ## ??
47 class Halibut(Fish):
48 pass
49
50
51 ## rover is-a Dog
52 rover = Dog("Rover")
53
54 ## ??
55 satan = Cat("Satan")
56
57 ## ??
58 mary = Person("Mary")
59
60 ## ??
61 mary.pet = satan
62
63 ## ??
64 frank = Employee("Frank", 120000)
65
66 ## ??
67 frank.pet = rover
68
69 ## ??
70 flipper = Fish()
71
72 ## ??
73 crouse = Salmon()
74
75 ## ??
76 harry = Halibut()
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12563)
Hello! Python by Anthony Briggs(9911)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9794)
The Mikado Method by Ola Ellnestam Daniel Brolund(9775)
Dependency Injection in .NET by Mark Seemann(9335)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8292)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7758)
Grails in Action by Glen Smith Peter Ledbrook(7693)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7018)
Microservices with Go by Alexander Shuiskov(6786)
Practical Design Patterns for Java Developers by Miroslav Wengner(6698)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6638)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6409)
Angular Projects - Third Edition by Aristeidis Bampakos(6047)
The Art of Crafting User Stories by The Art of Crafting User Stories(5579)
NetSuite for Consultants - Second Edition by Peter Ries(5510)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5312)
Kotlin in Action by Dmitry Jemerov(5061)
