10.Ending Up

oh ok sorry i m a stupid :frowning:

1 Like

thnk u for today tho

1 Like

I have no idea what has gone wrong here. Not liking the colon for some reason.
Would appreciate any insight on this?

nm silly me I figured it out.

on line 10, what is the purpose of putting “new_word” again before “[1:len(new_word)]”? just asking because that part confused me.

You’re telling it where to cut the new word.

baxter90 What did you figure out? I’m getting the same error.

On line 9 I had not actually applied the slicing to the new_word. Worked fine afterwards.

Thank you, that worked. I’m still curious as to why [1:len(new_word)] doesn’t work as it does in the instructions.I must be missing something.

Hello! I have a question.
I don`t know the reason about difference you and me.

at first, why you use word instead of original in line 7. you: first = word[0] me: first = original [0]

secondly, why you delete new_word[0:len(original)].
I just follow instructions, but there is no instructions about deleting new_word[0:len(original)].

I really want to know about it, because I am in stuck.

I assigned a new variable “word” because on line 4, I made sure that “original” was letters only and on line 5, i put it in all lowercase letter. If you want to use original, it may not pass if the user puts in random letters and numbers. As for deleting new_word[0:len(original)], when I looked over the code, it doesn’t do anything just sitting there. It’s not performing a function or assigning anything, so it gets deleted. Hope that helps

it really helped me! Thanks a lot :slight_smile:

try this:
pyg = ‘ay’

original = raw_input(‘Enter a word:’)

if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]

print s [1:5]
new_word = word[1:] + first + pyg
print new_word

print ‘empty’