Ending Up (pyglatin)


#1



https://www.codecademy.com/courses/python-beginner-2W5v7/1/4?curriculum_id=4f89dab3d788890003000096#


It appears for example with the word pizza "pizzapay" instead of "izzapay" when i run the code

i expect to run the code with for example the word pizza and i expect it to appear "izzapay"

pyg = 'ay'

original = raw_input('Enter a word:')

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


#2

This block of code,

word = original.lower()
first = word[0]
new_word = word + first + pyg

can be moved to where,

print original

is, and that line may be removed.

Your new_word value needs just one more change, the slice

new_word = new_word[1:len(new_word)]

then,

print new_word

#3

thank you for your help i finnally dit it!


#4

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