Does anyone know why his isn't working for me?


#1

pyg = 'ay'

original = 'Patrick'

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


New_word[1:len(new_word)]
#2

have you followed the instructions exactly? What error message are you receiving? Please post a link to this lesson. Thanks.


#3

I don't know how you have reached this far without it but orignal needs to store user input not a string,

for example,

original = raw_input("Please enter a word: ")


#4

I don't understand you


#5

pyg = 'ay'

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


#6

Your variable original should store the raw_input() method and not your name,

original = 'Patrick'

should store,

original = raw_input("any string: ")


#7

No matter how I change the program it keeps telling me I am wrong and that have printed the original value and the changed value


#8

That isn't the problem
Have you any other idea why it might not work?


#9

Also here,

print new_word[1:len(new_word)]

you are to store this line i the same varialbe new_word not print it out,

new_word = new_word[1:len(new_word)]


#10

This two lines should be exchanged so the input is first.


#11

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