MONTY string solution does not work and stuck at this lesson


#1


https://www.codecademy.com/courses/python-beginner-sRXwR/0/4?curriculum_id=4f89dab3d788890003000096#

Oops, try again. The value of fifth_letter is "MONTY" instead of "Y".


I expect that it should accept my solution and go ahead in the course. I am stuck at this lesson.


fifth_letter = "MONTY"
print fifth_letter[4]


#2

here:

fifth_letter = "MONTY"

you need to store the 5 letter in fifth_letter variable here, not the whole string

then you print fifth_letter variable to get the fifth_letter


#7

IT'S showing incorrect.
tried everything. stuck here .


#8

the fifth letter variable should only contain the fifth letter, not the whole string like arraysolver06397 did.

If you need further assistance, make a new (linked) topic as instructed in the guidelines, which i think you didn't bother to read


#11

Hello Statim!

I too am stuck on this questions and have tried all the variations I can think of, but to no avail.

I was, however, a little shocked to read your snippy reply to a perfectly good question.

You asked the person to read the guidlines.

Interestingly enough, the first line of the guidelines is: This is a Civilized Place for Public Discussion. Please treat this discussion forum with the same respect you would a public park.

Could I recommend that you reacquaint yourself with them?

As a moderator, being helpful and disinterested would go a long way.

Thank you!


#12

If i violate the guidelines, you can flag the reply as inappropriate the other moderators will agree or disagree with the flag.

I am within the guidelines in my own opinion.

I have helped hundreds of people, if we where all in a park many people would great me warmly


#13

In this lesson, you're taught that each character in a string has a number called an "index" assigned to it. To print the value of the index, you need to provide three things:

  • The variable
  • The string
  • The index

Once all three have been given, you'll be able to print the word tied to the specified index.

arraysolver06397 - You've given the variable and the string, but not the index. If you were to print fifth_letter as you have it, you'd only produce a string (which is why you're seeing MONTY in the interpreter). Add the index and re-run.


#14

Check the explanation in lines 10 and 11. The index follows the string. E.g., if you wanted the first letter, P, in PYTHON then:

first_letter = "PYTHON"[0]

Or for the fourth letter, H:

fourth_letter = "PYTHON"[3]

This should help with formatting your answer to get the fifth letter of MONTY.


#15

I am also stuck on this. Rereading the lesson and everything "MONTY" has 5 letters if counting M equal to 1.

If we are looking for the fifth letter, there would not be one. M=0, O=1, N=2, T=3, Y=4.


#16

May I recommend you checking out this topic.


#17

Ah... Thank you for the link. I just started to learn and knew I could not be the only person to find this.


#18