10/11


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/fr/courses/python-intermediate-fr-FR-ejrp4/1/4?curriculum_id=5370f030fed2a866a2000001#

<In what way does your code behave incorrectly? Include ALL error messages.>
I don’t see my mistake.
I would appreciate an help.

<What do you expect to happen instead?>

``` 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."

class VoitureElectrique(Voiture):
def init(self, type_batterie):
self.type_batterie = type_batterie

ma_voiture = Voiture(“DeLorean”, “argent”, 88)
print ma_voiture.afficher_voiture()

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

def conduire_voiture(self):
    self.condition = "comme neuve"
    return self.condition

ma_voiture = VoitureElectrique(“Lotus”, “noir”, 77, “pile thermique”)
print ma_voiture.condition
ma_voiture.conduire_voiture()
print ma_voiture.condition




Oups, merci de réessayer. Assurez vous que votre classe Voiture a une methode conduire_voiture().




In the console everything seems to be correct :

ceci est + self.modele +  + self.couleur +  avec  + str(self.mpg) + MPG.
nouveau
comme neuve
None
<do not remove the three backticks above>

#2

@snakefinger33gmail.c
Please re-edit your post and display the code with proper indentation…

You are asked to place the conduire_voiture() Method in
votre classe Voiture

Please re-edit your Post

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.

With Courtesy to stetim94
Im having a problem on lesson 11/23

or even better use
= How do I format code in my posts?
[extra’s]
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet


#3

Hi again Leoanard.
I have resolved this problem.
I am now trying to do the output function in part 21.


#4

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