FAQ: Code Challenge: Loops - Reversed List

This community-built FAQ covers the “Reversed List” exercise from the lesson “Code Challenge: Loops”.

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

Computer Science

FAQs on the exercise Reversed List

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!

A post was split to a new topic: Code challenge bug [solved]

5 posts were split to a new topic: Return will end a function and stop any loops

25 posts were merged into an existing topic: Return will end a function and stop any loops

6 posts were merged into an existing topic: How can I iterate over a list backward?

4 posts were split to a new topic: Could I just use reverse()?

2 posts were split to a new topic: My solution

7 posts were split to a new topic: What does lst2[len(lst2) - 1 - index] do?

3 posts were split to a new topic: Can I solve this with a reverse slice?

3 posts were split to a new topic: Could I make a list determining if they match?

A post was split to a new topic: This is my solution

And now for a spot of silliness…

>>> a = [3, 5, 7]
>>> b = [8, 5, 3]
>>> c = zip(a, b[::-1])
>>> d = map(lambda x: set(x), c)
>>> e = filter(lambda x: len(x) != 1, list(d))
>>> list(e)
[{8, 7}]
>>> a = [3, 5, 7]
>>> b = [7, 5, 3]
>>> c = zip(a, b[::-1])
>>> d = map(lambda x: set(x), c)
>>> e = filter(lambda x: len(x) != 1, list(d))
>>> list(e)
[]
>>> 
1 Like

3 posts were merged into an existing topic: Sharing solutions

5 posts were merged into an existing topic: What does lst2[len(lst2) - 1 - index] do?

8 posts were split to a new topic: Could I solve this using reverse()? Is it efficient?

3 posts were merged into an existing topic: Sharing solutions

2 posts were split to a new topic: Why doesn’t this code work?

4 posts were split to a new topic: Is this code okay?

3 posts were merged into an existing topic: How can I iterate over a list backward?

2 posts were merged into an existing topic: Sharing solutions