My code works, but it's not the "official" way, so I'm still stuck at this excersize!


It works perfectly after you type it in twice. The first time simply repeats the word that it did last, the second time does exactly what its supposed to.

pyg = 'ay'
first = word [1:] 
second = word [0]
original = raw_input('Enter a word:')
new_word = first+second+pyg
if len(original) > 0 and original.isalpha():
    print new_word
    print 'empty'


It works perfectly after you type it in twice

It throws an error, can you elaborate on It works perfectly ? (I just have tested it)

Read instructions again!

further hint**

You have tried to slice word even before defining it.
When a variable is not defined (by defined I mean if It carries any data in it)
It will throw an error if you try to do any calculation using it.

do reply if you get the hints or not!


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