My code is not working


#1

Please I don't understand what you mean by that


Need help with 10 ending up
#2

Which point do you not understand?


#3

Like my code is not working.
pyg = 'ay'

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

if len(original) > 0 and original.isalpha():
print original

else:
print 'empty'


#4

It tells me to write a word in the console window, then says that it is take for example pythonpay instead of ythonpay


#5

Those lines should be just under the input statement.

This is still an issue.


#6

I was stuck too. Then I changed this line and it worked for me.
new_word = word[1:len(word)] +first +pyg


#7

That worked for me too. How were we suppose to infer that based on the instructions? The instructions give no indication that is what you're suppose to do. Even what they tell you to type is incorrect.


#8

I tried doing it a similar way, but could never get it to work.
I had: new_word = word + first + pyg [1:len(new_word)]
It worked correctly, but said I didnt have the right string.

I ended up with this as the correct answer:

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

I didnt get any of this from the instructions at all, just about 30 minutes of playing with it on my own. :confused:


#9

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