Invalid syntax error?


pygLatin 10 ending up

system returns an error pointing to the colon in "[1:len(new_word)]"

that variable is exactly what the exercise prompted

pyg = 'ay'

original = raw_input('Enter a word:')
word = original.lower()
first = word[0]
new_word = [1:len(new_word)]

if word[0] == "a" or "e" or "i" or "o" or "u":
            new_word = word + pyg
            print new_word
            new_word = word[1:] + word[0] + pyg
            print new_word


When you slice something you have to say what that something is, same as you have to specify what you're getting the first element of when accesing by index


That isn't going to compare "e" to word[0]


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