10/10 syntaxe error and error message


#1

hello everyone ,

pyg = 'ay'

original = raw_input('Entrez un mot :')

if original.lower() and len(original) > 0 and original.isalpha():
print original
else:
print 'vide'
mot=original.lower()
premiere=mot[0]
nouveau_mot = mot + original + pyg
nouveau_mot = nouveau_mot[1:len.(nouveau_mot)]
print original

                                I don't understand why there are :

File "python", line 12
nouveau_mot = nouveau_mot[1:len.(nouveau_mot)]
^
SyntaxError: invalid syntax

                              and :

Oops , thank you again. Make sure that you assign the translation to nouveau_mot in the else branch of your if / else .

:neutral_face: :slight_smile:


#2

The correct usage of len is len("String"). (remove the dot)


#3

Thank you very much for your help


#4

You're welcome :slight_smile:

(20char)