Introduction to classes 9/18


#1



https://www.codecademy.com/fr/courses/python-intermediate-fr-FR-je5q0/1/4?curriculum_id=5370f030fed2a866a2000001#

My code seems to be correct but it doesn't pass.
Is there a bug on the french version of this exercise Please


class Animal(object):
    """Fait des animaux mignons."""
    est_vivant = True
    sante = "bonne"
    
    def __init__(self, nom, age):
        self.nom = nom
        self.age = age
       
    def description(self, nom, age):
        self.nom = nom
        self.age = age
  
hippo = Animal("Zox", 7)
paresseux = Animal("Zak", 2)
ocelot = Animal("Zoop", 5)
print hippo.sante
print paresseux.sante
print ocelot.sante

Oups, merci de réessayer. Votre code semble un peu étrange. Jetez un oeil à l'indice si besoin! 

And in the console it's correct :

bonne
bonne
bonne
None


#2

Hi @snakefinger33gmail.c ,

There seems to be a bug in Codecademy's submission correctness test (SCT) for this exercise.

Add this, as a global function definition, to the end of your code, to pass ...

def aattr(*args):
    return True

Introduction to classes "Ils se multiplient" ex 9
#3

Thanks a lot.
I found it on the forum before.
Happy Coding :sunglasses:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.