This is my code and for some reason its not working.

pyg = 'ay'

original = raw_input('Enter a word:')

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

Oops, try again. It looks like new_word contains "pizzatay" instead of "izzapay"!

I went back and am not s sure how to fix this.


Those lines would go where the print original line is. There is still an error, though. first is referred to before being defined.

first = word[0]
new_word = word + first+ pyg

Now it is defined when it is referenced.


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