PygLatin


#1




File "python", line 10
[1:len(new_word)]
^
SyntaxError: invalid syntax


It gives me an error on the : in the [1:len(new_word)] i dont really see where i did wrong because i thought this shuld do its stuff. and i dont understand why the ":" is the problem because they used this as example in the lesson. someone any sugestions?


pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    print original
    word = original.lower()
    first = word[0]
    word = new_word
    [1:len(new_word)]
else:
    print 'empty'


#2

you need to split the variable word and new_word to store their own values as instructed,

word = # a value

new_word = # another value

and this slice should be stored in a variable named new_word but also refer to the variables first and pyg ,

[1:len(new_word)] + first + pyg #should be stored in new_word variable


#3

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