Coding enthusiasts, please verify!


#1

Hi Coders! Is this pyg latin code correct? Please give me a thumbs up if it is. Thanks!

pyg = ‘ay’

original = raw_input(‘Enter a word:’)

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


#2

The above should be the first definition of new_word, followed by the line you have preceded it with.

new_word = new_word[ slice ]

#3

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