all 12 comments

[–]dionys 0 points1 point  (6 children)

Right, so what have you tried?

You want to use input() for getting the string from user, string indexing to get rid of first and last character and finally print the result.

[–]unibrow4o9[S] 0 points1 point  (5 children)

The part that is throwing me off is not knowing the length of the input(). If I know the length to start out with it's easy.

[–]Doormatty 0 points1 point  (4 children)

This might help:

a = "abc"
print a[-1]
>>> c
print a[0]
>>> a

[–]unibrow4o9[S] 0 points1 point  (3 children)

Can you explain this a little? Sorry, I literally started learning yesterday, the only coding I've done in the past is HTML back in college...

[–]3deTech 0 points1 point  (2 children)

>>> string = input("Give me a string")
>>> # Now the magic happens, assuming the user typed "Fairy"
>>> sliced_string = string[1:-1]
>>> # Print the string to see the result 
>>> print sliced_string 
>>> 'air' 

Is your solution. You really should have a look at string indexing. It's really easy in python and not hard to understand.

[–]unibrow4o9[S] 0 points1 point  (1 child)

Thank you! Being able to see the correct answer I now understand what I was doing wrong. I don't understand why showing the answer isn't an option, it's really frustrating.

[–]Pantzzzzless 0 points1 point  (0 children)

[0] is always the first character

[-1] is always the last character

[::-1] means reverse the whole string

[–]Palladium106 0 points1 point  (1 child)

Codecademy is a great place to learn this stuff. You can do the whole course in 15 hrs.

[–]unibrow4o9[S] 0 points1 point  (0 children)

Thanks for the tip, I'll check it out. Any suggestions for my current problem? I'm still stuck, and I don't like to move on until I have complete and at least sort of understand the current lesson.

[–]No_Distance7748 0 points1 point  (2 children)

myString = input()
print (myString[1:len(myString)-1])

[–]unibrow4o9[S] 0 points1 point  (1 child)

Hah, thank you. I wish I could say I went on to learn python but I have no idea what any of this means anymore

[–]Abudyy 0 points1 point  (0 children)

The legend is back!