Please help comunity (Ending Up)


Ending Up

Oops, try again. The value for the original variable looks off, make sure that you entered a word containing only letters.

s = "Charlie"
s = s.lower()
print s[0]
print s[1:4]
new_word = s
print s[1:len(new_word)]


Firstly, you do not have a variable named 'original'. Try to use the same name for variables and functions that the exercise tells you to use.

Where is the raw_input? It shouldn't be a set string if you ask me.

Printing from index 1 through 4 isn't ideal for different-length words.

Why have new_word equal s, when you can just print the length of s instead?

It seems like you copied the example given....... That will mess up your code, as for this exercise it does not work correctly. Why not try making your own code?

I see no 'pyg' variable, no variable to hold the first letter of 's', or 'original' (or whatever you want to call it), no variable that adds all of those things together. There is nothing to store the result of slicing that final variable, either.

Do you check if the entered input isn't empty or consists of only letters?

What I see is that you just copied directly from the example from the exercise, and did not follow the directions. Do exactly what the exercise tells you to do, and then if it works, you can mess around with the code.


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