8/11 & 9/11


#1



Please i need absolutly an Help because even if the code seems to be correct nothing works.

https://www.codecademy.com/fr/courses/python-intermediate-fr-FR-ejrp4/1/3

Something went wrong
Click Close to try again or refresh the page.

class Voiture(object):
    condition = "nouveau"
    def __init__(self, modele, couleur, mpg):
        self.modele = modele
        self.couleur = couleur
        self.mpg   = mpg
        
    def afficher_voiture(self):
        return "ceci est" + self.modele + ""  + self.couleur +  "avec"  + str(self.mpg) + "MPG."
        
    def conduire_voiture():
    self.condition = "usé"

    ma_voiture = Voiture("DeLorean", "argent", 88)
print ma_voiture.condition
ma_voiture.conduire_voiture()
print ma_voiture.condition
class VoitureElectrique(Voiture):
    def __init__(self, modele, couleur, mpg, type_batterie):
        self.modele = modele
        self.couleur = couleur
        self.mpg   = mpg
        self type_batterie = type_batterie
ma_voiture = VoitureElectrique("Lotus", "noir", 90, "pile thermique")


#2

This line should not be indented...

    ma_voiture = Voiture("DeLorean", "argent", 88)
self.type_batterie

def afficher_voiture(self):
    print "ceci est " + self.modele + " " + self.couleur + " avec " + str(self.mpg) + " MPG."

alternate...

print "Ceci est %s %s avec %s MPG." % (self.couleur,self.modele,str(self.mpg))

#3

Thank you very much for your help.


#4

Thank you for you response.
I have resolved it and now i try to do the part 21.


#5

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