No I don’t, I accidentally looked at the source code for ex42 instead of 41. I don’t see any classes in ex41 because there are no code with the keyword “class”. Help.
Well this aplies to anything in a Python file that start with ”class”
Next comes the name of the class.
And they always starts with a uppercase letter.
Myclass
Then it is a bit different sometimes.
They can end with a
: or
(): or
(object):
If the brackets contains a name it is the ”parent class” of the current one.
On this one you are suppose to write down in a file called oop_test.py.
When you run it
python3 op_test.py
it will give you a piece of a class.
You are suppose to give it a name.
Then the answer comes after
class Drop(Downtown): # explain this.
> make a class named Drop that is-a Downtown # you answer
ANSWER: Make a class named Drop that is-a Downtown. # The program gives the correct answer
doll.chain = 'dog'
> # Your call again.
When I did the book for Python 2 Zed was very clear that all code should not be copied and pasted. One learn better if type it your self.