PygLatin - Move it on back


Here's my code so far:

original = raw_input('Enter a word:')
pyg = 'ay'

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

When I run the code, the terminal gives me:

Enter a word: python

Why won't the program give me a new word? Is there something wrong with the variables below?


@codecadet101: You're not actualling printing the new_word.

print new_word

And things should work just fine.


@g4be : but according to the problem the first letter of the word should be stripped.

new = word.strip(original[0])
first = word[0]
new_word = new + first + pyg
print new_word


@san.deep: Stripping the first, second, nth letter of a string and printing it, which in this case is in new_word, are quite different.


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