Erreur name 'N' is not defined
Roms
-
dsy73 Messages postés 9917 Statut Contributeur -
dsy73 Messages postés 9917 Statut Contributeur -
Bonjour,
j'essayer de faire fonction mon code python mais j'ai comme erreur :
voici mon code :
j'ai executer se sur un site qui permet interpreter python car j'ai n'ai plus de place pour l'installer sur mon pc et il utilse Python v2.7.5 (lien du site :http://www.tutorialspoint.com/codingground.htm
EDIT: Précision du langage dans la coloration syntaxique.
j'essayer de faire fonction mon code python mais j'ai comme erreur :
N.py
------------------------------------------------------
--------------------
NameError Traceback (m
st recent call last)
<ipython-input-12-901514de3e7a> in <module>()
----> 1 N.py
NameError: name 'N' is not defined
voici mon code :
def cleDeControle(chars):
factor = [7, 3, 1]
result = 0
for index, char in enumerate(chars.upper()):
if char == '<':
char = 0
elif char >= 'A' and char <= 'Z':
char = ord(char) - 55
else:
char = int(char)
result += char * factor[index % 3]
return result % 10
print cleDeControle('vreyvrjuknfhgdsvfbgbgfnfgfdsgdbx12347brgdac')
j'ai executer se sur un site qui permet interpreter python car j'ai n'ai plus de place pour l'installer sur mon pc et il utilse Python v2.7.5 (lien du site :http://www.tutorialspoint.com/codingground.htm
EDIT: Précision du langage dans la coloration syntaxique.
A voir également:
- Nameerror: name 'n' is not defined
- What is my movie français - Télécharger - Divers TV & Vidéo
- Who is on my wifi - Télécharger - Outils Internet
- Where is it - Télécharger - Gestion de fichiers
- The media could not be loaded, either because the server or network failed or because the format is not supported. ✓ - Forum Mozilla Firefox
- Could not connect to server - Forum TV & Vidéo
1 réponse
Salut
ton code pour Python 2 fonctionne, je n'ai pas vérifié la réponse : 3.
Installe Python 2, l'installateur ne fait que 16 Mo.
ton code pour Python 2 fonctionne, je n'ai pas vérifié la réponse : 3.
Installe Python 2, l'installateur ne fait que 16 Mo.