Python - Fr : Typo Error


Hello, it seems there is a little typo error in the introduction of this chapter.
Indeed, in the last condition, the function clinic() is called, instead it should be clinique() (which is clinic() in french)

Traceback (most recent call last):
File "python", line 13, in
File "python", line 11, in clinique
NameError: global name 'clinic' is not defined

The clinique() function should be called instead.

def clinique():
    print "Vous entrez dans la clinique !"
    print "Voulez-vous prendre la porte de droite ou de gauche ?"
    reponse = raw_input("Tapez 'droite' ou 'gauche' puis validez avec 'Entree'.").lower()
    if reponse == "gauche" or reponse == "g":
        print "Vous etes dans la salle d'attente."
    elif reponse == "droite" or reponse == "d":
        print "Vous etes dans la salle d'operation. Sortez vite !"
        print "Vous n'avez choisi ni la droite ni la gauche, essayez encore !"



Being an old track course there is not much chance this will get edited. Fortunately for us it does not impede the learner. It does jump out from the page, though, being so obvious. It will raise an exception if that branch is followed by the program.


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