Need help with Pig Latin


#1

I figured out - thanks. Please ignore !

Hi

**In the below code: if I leave original = raw_input, it shows an error and doesn't take the count of the input. And if I put raw_input as string then it is fixed. So I am forced to write original=raw_input("Enter a word:) which asks for the input twice.**** Please tell what I am doing wrong?

raw_input("Enter a word:")
original = raw_input
if len(original)>0:
print original
else:
print 'Empty'


Replace this line with your code.


#2

Are you on #4 Check Yourself! ?


#3

No #3, the one just before that. The code works evenutally but asks for the user inputs twice.

Thanks,


#4

Ok well hopefully your other lessons go smoothly! Happy coding!


#5

So i got the result printed out correctly, but it keeps showing this error.
"Oops, try again. It looks like you printed the correct translation of "name", but make sure to set new_word equal to the slice as well."
Please show me how to fix it. Thanks

pyg = 'ay'

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

if len(original) > 0 and original.isalpha():
print original
else:
print 'empty'


#6

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