FAQ: Code Challenge: Loops - Reversed List

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

2 posts were split to a new topic: What do you think of this solution?

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

12 posts were merged into an existing topic: Did you double check the placement of return?

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

5 posts were merged into an existing topic: Did you double check the placement of return?

2 posts were split to a new topic: Why don’t we use else?

10 posts were merged into an existing topic: Could I solve this using reverse()? Is it efficient?

2 posts were merged into an existing topic: Did you double check the placement of return?

3 posts were merged into an existing topic: Did you double check the placement of return?