Please help me where is mistake


#1



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


Oops, try again. It looks like you printed the correct translation of "nishant", but make sure to set new_word equal to the slice as well


pyg = 'ay'
original = raw_input('Enter a word:')
word= original.lower()
first= word[0]
second = word[1]
third = word[2]
new_word = word[1:len(word)]
if len(original) > 0 and original.isalpha():
     
    print new_word + first +pyg 
    print 'empty'


#2

This should follow immediately after the input. Follow the step by step instructions inside the if branch, and have only print "empty" in the else branch.


#3

I tried to do this differently. Still getting the same error.
As per you I should have if statement just after the input , but what difference is it going to make to the logic ?


#4

A big difference. We never leave validation to the end, but immediately after input. Read the instructions, and follow them to the letter. Where is your else:?


#5

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