Seymore4Head at Hotmail.invalid
Fri Oct 31 15:05:47 CET 2014
On Fri, 31 Oct 2014 10:05:03 +0100, "ast" <nomail at invalid.com> wrote:
>"Seymore4Head" <Seymore4Head at Hotmail.invalid> a écrit dans le message de
>news:51755at03r0bidjqh3qf0hhpvjr8756ill at 4ax.com...
>> class pet:
>> def set_age(self,age):
>> def get_age(self):
>> return self.age
>> Traceback (most recent call last):
>> File "C:\Functions\test.py", line 18, in <module>
>> TypeError: set_age() missing 1 required positional argument: 'age'
>> I am trying to pass 4 as the age. Obviously I am doing it wrong.
>I am a beginner too, but I find it strange that your
>pet class has no __init__ method to construct
Because the topic of that lesson was getter setter.
I can construct an __init___ but I was practicing get/set.
This stuff is coming to me slowly. I need to rinse and repeat quite a
few more times, before I follow what is going on.
More information about the Python-list