My Code is Running but Not Returning Desired Outcome


#1

Hi!

Link:
https://www.codecademy.com/courses/learn-python/lessons/pyglatin/exercises/ending-up?action=lesson_resume

My code passes the system check, however, when I type the string “Pig”, it does not return “iggay”

Here’s a sample of the code:

```python

pyg = ‘ay’

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


#2

Set new_word equal to the slice from the 1st index all the way to the end of new_word. Use [1:len(new_word)] to do this

you never set new_word equal to the slice?

after you have done this, you can print new_word to get the pyglatin translation


#3

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