Move it on back- doesn't prints original instead of new_word


#1

Hi there, so in 'move it on back' I changed print original to print new_word, and yet the translator still only prints original. I coded as below, and expected the result to be lowbay, instead it was simply Blow- exactly what I typed in. It allows me to go to the next lesson, so I'm not stuck- only curious why it doesn't work the way I expected it to.
Many thanks :slight_smile:

pyg = 'ay'

original = raw_input('Enter a word:')
word = original.lower() 
first = word[0]
new_word = word + first + pyg

if len(original) > 0 and original.isalpha():
    print new_word
else:
    print 'empty'


#2

I would, put my setting variables in the if statement, but I guess that's just preference.

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
else:
    print 'empty'

The code is not done. They will ask you to change the new_word string a little bit more before the program works as expected.


#3

Yeah as @tekkie1618 said in 10.) Ending Up you will finish it off and it will do what it is supposed to. My code is just like @tekkie1618 and when I type in pig I get pig back


#4

Great, thank you!
I just finished the project and all worked smoothly :heart_eyes_cat:


#5

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