[Tutor] Help with Multiple Inheritance in Classes

Alan Gauld alan.gauld at yahoo.co.uk
Wed Feb 8 04:06:34 EST 2017


On 08/02/17 07:11, Vusa Moyo wrote:
> I have a suspicion my lecturer's question is flawed, so I'd like to pose it
> to you guys to confirm my suspicions.

I think your interpretation of the question is flawed.
See Peter's reply for why.

However another point is....

>  class Cat:
>      name = ""
>      kind = "cat"
>      color = ""
>      value = 100.00
>      def description(self):
> 
> desc_str = "%s is a %s %s cat worth R%.2f." % (self.name, self.color,
> self.kind, self.value)

Python is sensitive to indentation. This line needs
to be indented inside the def statement. (This may
be a mail formatting issue but since the rest of
your code looks OK I doubt it)



-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list