Lesson 10 Ending Up - Stuck


#1



Lesson 10 - Ending Up


Oops, try again. word should contain the .lower()-case version of original.


Not sure why it keeps throwing this error. I realize my code doesn't use both the "word" and "original" variables, which for some inexplicable reason Codecademy decided to change around for random chapters in this. However I've adjusted the variable names to compensate without success. Any idea what I am missing here?

Thanks!


pyg = 'ay'

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


#2

Try setting the raw input equal to an original variable, and then setting word equal to original.lower(). Your code should work, but the code checker is sometimes picky.


#3

thx! but but I still got an error


#4

You are missing the 'original' variable. That's the word that will be modified with later lines of code.

It should look like original =


#7

This code is giving suggestion to add slice…not getting…please help

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
print new_word[1:len(new_word)]
else:
print ‘empty’


#8

There’s a good site that has the answers and y’all can try to understand the wrong things like i did
https://github.com/ummahusla/Codecademy-Exercise-Answers/tree/master/Language%20Skills/Python


#9

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