I got the correct code but it won't let me pass

Hello, @blog3326413276! Sorry, you’re getting frustrated. I just looked at the instructions for this lesson, and they are a bit confusing. If your code looks like the code in the post that you replied to, you have extra lines that don’t belong. The examples shown in the lesson text near the beginning are just examples. They’re not to be used in your code. You just need to follow the instructions, and click “Run” when indicated after each step. If you aren’t seeing the expected results in the browser window on the right of the screen, you may have an issue with the browser you are using to access Codecademy. Codecademy works best on Chrome and Firefox. From my experience it doesn’t work well at all with Edge.

I suggest you reset the lesson, and try again entering only the code asked for in the instructions. I’ve included what your code should look like below if you get stuck.

SPOILER:

// Build a list
comicStrip = ['Codey sees the trail', 'Codey starts the hike', 'Codey is halfway', 'Codey reaches the finish']

// select the 4th item from the list
// and save it to the variable selection
selection = comicStrip[3]

Good luck & happy coding!

Many thanks that’s really helpful.

Gill Dawson

1 Like

What does it mean when it says " First, create a list called comicStrip"? I literally just wrote comicStrip = (listed items, etc.). but how does it know that I am making a list by just typing “comicStrip”? shouldn’t i type something like myList=comicStrip?

Python automatically determines the data type. so using [] will be recognized as a list by python.

then there are languages like java where you have to indicate the type:

int numberOfDays = 7; 

int declares the data type.

Capitilization is KEY in this excercise :stuck_out_tongue:

comicStrip = ['Codey sees the trail', 'Codey starts the hike', 'Codey is halfway', 'Codey reaches the finish']
// select the 4th item from the list
// and save it to the variable selection
selection = [4]

this is my line of code . One thing that I don’t understand is… It is asking to select the 4th item from the list… the list length is equal to 4 but if we have the index of this list as [0,1,2,3] and 3 is the 4th variable why this code give me the message “NOT CORRECT SELECTION” … reading all the comments about this lesson I tried everything i could but I am not sure if I am getting the right result…

so the 4th item is at index 3, when i count elements in a list i usually start at one. The 4th index would have been problematic indeed.

here:

selection = [4]

you just make a new list with the value 4, i don’t see comicStrip anywhere, how is the python interpeter to know you want the an element of an existing list without mentioning this?

It makes sense @stetim94. I apologized that I didn’t past the URL for this exercise… I’ve already moved on with the course but I’ll try to get back to it and share the link of comicStrip…

no problem.

Always better to solve the issue on your own :slight_smile:

1 Like

I know… I am getting there eventually!:+1:

Thanks so much!
this helped a lot.

1 Like

You should thank @stetim94… without his feedback, it would take a while to figure this out! :slightly_smiling_face:

guys make sure you read the comments carefully and use exact variable name.
variable names are case sensitive.

// Build a list
list=[‘trail’,‘hike’,‘halfway’,‘finish’]

// select the 4th item from the list
// and save it to the variable selection
list[3]
selection = list[3]

this code will work ten billion percent…:star_struck::star_struck:

this line:

list[3]

doesn’t seem to do anything.