On 09/02/17 10:42, Vusa Moyo wrote:
> Thanks so much. You've been a great help.
>
> You have confirmed that the lecture's question is flawed.
It is not, it is exactly right.
(Albeit unusual in its use of class attributes) but there is
nothing wrong with the code, only the way you were trying to u
Thanks so much. You've been a great help.
You have confirmed that the lecture's question is flawed.
Appreciate the help.
Regards
Vusa
On Thu, Feb 9, 2017 at 12:02 PM, Alan Gauld via Tutor
wrote:
> On 09/02/17 09:25, Vusa Moyo wrote:
>
> > class Cat:
> > name = ""
> > kind = "cat"
> >
On 09/02/17 09:25, Vusa Moyo wrote:
> 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)
> return desc_str
>
> The abov
Hi Alan.
You are correct with the indentation.
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)
return desc_str
The above code is th
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 = ""
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.
>
> Here goes..
>
> I've gone and created a Class Cat1(cat): <-- inherited class, but cant
> seem get the code right which allows the test code to run successful
I have a suspicion my lecturer's question is flawed, so I'd like to pose it
to you guys to confirm my suspicions.
Here goes..
I've gone and created a Class Cat1(cat): <-- inherited class, but cant seem
get the code right which allows the test code to run successfully.
We have a class defined for