Ending Up


#1

hi all, the following code does not work:

and the error says: word should contain lower case version of original


#2

@megablaster00207: Use the lower() function before doing all of these operations.
Like the error message showed you, word should contain the .lower()-case version of original.


#3

hi, still not good...

pyg = 'ay'

original = raw_input('Enter a word:')

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


#4

@megablaster00207: Your code is fine, maybe you didn't follow an instruction that was given to you on the lesson.
Check the instructions and if you're still getting the error, refresh the page and try again.


#5

This works (4 me @ least)
pyg = 'ay'
new_word = word + first + pyg
new_word = new_word[1:len(new_word)]

original = raw_input('Enter a word:')

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


#6

Why? What's wrong?


#7

what's wrong?


#8

@gigarunner95509: You must follow the instructions that were given to you at the lesson.
Your screenshots informs you that you need to "set new_word equal to the slice as well".

Even if your code is correct, not following the given instructions won't let you pass the lesson.


#9

Thank you very much)


#10

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
new_word = word + first + pyg
new_word = new_word[1:len(new_word)]
print original
print new_word
print first
else:
print 'empty'
your code is not working :cry: so I fixed some code. It's working! :slightly_smiling:


#12

I can swear it was working!?!??! Never mind, thnx for check, I've found another solution:
pyg = 'ay'
original = raw_input('Enter a word:')

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