Problem in the exercises


#1

I'm having trouble in one of the exercises. An error message says ". Oops, try again It seems that new_word and equal to" facafay "instead of" acafay "!". But the console shows:
"Enter a word: faca
acafay
none "

My code is:
pyg = 'ay'

original = raw_input('Entre com uma palavra:')

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

Thanks


#2

If the variable contains one thing and you printed another, then you printed something other than that variable, right.


#3

I don't getted. For me, i'm doing what the exercises want, but he is saying that i'm not!
But the console shows the right thing!
Could you point in what line is the error?

Thanks


#4

Your variable new_word equals to word + first + pyg. Variable, without further manipulation, must give correct output. In layman's terms:

print new_word

without slicing ([1:]) must give the correct output. It's variable that matters, not print output.


#5

Got it!!!
Thank you :slightly_smiling: