Please help!

// 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]

This is the code I put in ,but it doesn’t work at all, I don’t know what’s wrong with it. please help ,thank you in advance!

Hi,
The fourth entry in your list doesn’t appear to have quote marks around it.
So it’s treating Codey, reaches, the and finish as undeclared variables - and you can’t put them in a list like that.

If that’s not it, do you have a link to the lesson, so we have a bit more context.

Hope that helps

2 Likes

// 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
comicStrip[3]
// and save it to the variable selection
selection = comicStrip[3]

Hi ,thank you ,it works!!

1 Like

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