FAQ: Lists - Putting it Together

This community-built FAQ covers the “Lists: Putting it Together” exercise from the lesson “Lists”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn How to Code

FAQs on the exercise Lists: Putting it Together

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

21 posts were merged into an existing topic: I got the correct code but it won’t let me pass

16 posts were merged into an existing topic: I got the correct code but it won’t let me pass

A post was merged into an existing topic: I got the correct code but it won’t let me pass

6 posts were split to a new topic: Do I need to use mylist?

3 posts were merged into an existing topic: I got the correct code but it won’t let me pass

A post was split to a new topic: I got the correct code but it won’t let me pass

lists. Putting it all together…Plzz notice me… just want to ask if in every exercise the only code that runs are the code that was asked in the instruction?? because i was trying to add code from previous step on the topic but i coudnt see changes in the right panel… plzz tell, my code is like this


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

comicStrip.pop()

There are no print statements to display any output? So no surprise you see nothing in the right panel

what you mean po…? coz when i run this code it has an output in the right panel…
and what was that print statement u talk about po.

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

but when i run this code it has an output on the right panel but it doesnt read the code that i have added. :frowning: i think i have a wrong code, plzz help


comicStrip.append('Codey meet new friend')

i don’t see po… withint my reply?

What do you expect to see in the output window and why?

That line will shorten the list but nothing is logged to the console. In this exercise we don’t want to destroy or mutate the list as much as poll one of the elements.

selection = comicStrip[3]
console.log(selection)

‘po’ is a word we filipino use to show respect to other people… Sorry for using it here,…
well i am expecting that in this exercise ‘Putting it all together’, i can use all what i have learn in the List topic, like adding a list, removing a list, through the code i write but it comes out that it seems the ‘computer’ didnt read my console coz it didnt show on the right panel the output i am expecting and i guess my code is correct.
i hope you understand po coz im not so good in explaining what i mean,

po?? sorry sir but can i ask more…? honestly i dont understand what you mean, can i have further explanation on that? Thank you in advance,

well, Do you mean sir that my code comicStrip.pop()
is correct only the panel cant show the output i expect??
plzz bear with me coz im a slow learner, :frowning:

displaying output requires logging it using console.log(), i don’t see you use console.log anywhere?

1 Like

Correct is not the word I would use unless two things can be counted upon…

  1. Given we are looking for the fourth element in the list, it would have to be the last one in order for .pop() to be able to extract it; and,
  2. the output is logged so we can see it on the display.

The other condition would be that it doesn’t matter what happens to the original list. .pop() mutates the list so anything that is popped from the list will no longer be in the original.

In this particular problem, given we are instructed to extract the fourth element of a list that we don’t know the length of (let’s say) then to most direct and non-presumptive approach would be to use the subscripted index, [3].