Ending up



pyg = 'ay'

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

if len(original) > 0 and original.isalpha():
print original[1:len(new_word)]
print 'empty'

Error message: It looks like new_word contains "missmay" instead of "issmay"!

I can't see where's the error.

Could someone help please?




you take slice of new_word, which you need to store in new_word variable so new_word contains the full translation.

are you sure you want to validate the user input (if condition) before getting first letter? If the user doesn't enter anything, you program will crash


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