String index bug


#1



Strings & Consoles String Methods intro

" MONTY" is incorrect somehow. Then it acts like I hadn't asked for the fifth letter. What gives?"


Replace this line with your code.


#2

link of problem would be a great help to find your problem!provide the link


#3

If " MONTY" is what is in your code, then yes it is incorrect as there is a space that throws off your letter count.

In this exercise you are accessing the letter by the index, which starts at zero. So you assign the fifth letter in a variable by accessing the index location, using the method described in the instructions, then print that variable.

As stated, it is significantly easier to help if you provide a link to the problem as well as paste your code in to the message where it says "Replace this line with your code."


#4

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