Provided solution doesn't work?


I clicked ‘provide solution’ and it gave me this code

pyg = 'ay'

original = raw_input('Enter a word:')

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

It allowed me to pass the lesson but the code doesn’t actually work properly, and I don’t know why. It neither prints the answer or when I add print new_word it doesn’t print the right answer…


you don’t have a print statement to print new_word? the program is working fine, except for displaying output


It doesn’t properly translate the word into pig latin, at least it didn’t print properly to the console… And I removed print new_word in this post, it was just something I tried.


doesn’t translate properly how?

if you remove the print statement, of course it won’t print to the console


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