Python, Pyglatin, Ending UP


#1



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


I get the error
Oops, try again. It looks like new_word contains "pythonpay" instead of "ythonpay"!
like
new_word = word + first + pyg
print original
is in the wrong order


pyg = 'ay'

original = raw_input('Enter a word:')

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


#2

What is this supposed to do?

Why do you need to print the input? Aren't you supposed to print the result (new_word)?
Also, instructions state:

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.


#4

right code which work is below

pyg ='ay'

original = raw_input("Enter your word : ")
if len(original) > 0 and original.isalpha():
** word = original.lower()**
** first = word[0]**
** new_word = word + first + pyg**
** print(new_word[1:len(new_word)])**
else:
** print("Empty")**


#5

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