Passed, but words are not turning into pyglatin?


#1

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:]
print original
else:
print "empty"

I type in "curt" and in the console, curt then none just pop up.


#2

Maybe the first print is "new_word" but not "original".


#3

Made no difference, still passed despite the pyg latin translation not even functioning.


#4

hi my English is poor .
the function of the "pyg" is to add the letters "ay" to the tail of the word that you entered.
for example .if you entered "good",it will return "oogday".
Can you understand me?
the following are my codes:
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:]
print new_word
else:
print 'empty'


#5

I copied your code and compared it to my code, my code is exactly the same as yours except, I typed in:

print original

while you did:

print new_word

That was my error

Thank you r_python1 :slight_smile:


#6

@chemicalcurt you are welcome.may i ask a question?where are you from?


#7

I am from Thailand :slight_smile:


#8

wow,a beautiful neighbor country. :grinning:


#9

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