---
title: "Comment by Amal Shaji on \"Five++ cool Python snippets (Part - 2)\" | Hashnode"
description: "Fixes: Lambda Function &gt;&gt;&gt; arr_list = [[1, 4], [3, 3], [5, 7]] &gt;&gt;&gt; sorted_list = sorted(arr_list, key=lambda x: x[1]) &gt;&gt;&gt; sorted_list"
url: "https://hashnode.com/posts/five-cool-python-snippets-part-2/60dbfe1a7ad49f6471accee8/comment/60dc22847ad49f6471acd4d3"
---

[Discussion](https://hashnode.com/posts/five-cool-python-snippets-part-2/60dbfe1a7ad49f6471accee8)

Comment [Five++ cool Python snippets (Part - 2)](https://hashnode.com/posts/five-cool-python-snippets-part-2/60dbfe1a7ad49f6471accee8)

[Amal Shaji](https://hashnode.com/@amal)

[Jun 30, 2021](https://hashnode.com/posts/five-cool-python-snippets-part-2/60dbfe1a7ad49f6471accee8/comment/60dc22847ad49f6471acd4d3)

Fixes:

1.  Lambda Function
    
    ```
    >>> arr_list = [[1, 4], [3, 3], [5, 7]]
    >>> sorted_list = sorted(arr_list, key=lambda x: x[1])
    >>> sorted_list
    [[3, 3], [1, 4], [5, 7]]
    ```
    
2.  Sliding windows
    
    ```
    >>> from itertools import islice
    >>> def slide(list_name, window_size):
    ...           z = [islice(list_name, i, None) for i in range(window_size)]
    ...           return zip(*z)
    ```
    

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi)

[Jun 30, 2021](https://hashnode.com/posts/five-cool-python-snippets-part-2/60dbfe1a7ad49f6471accee8/comment/60dc22847ad49f6471acd4d3#reply-60dc29377ad49f6471acd706)

Hey [Amal Shaji](https://hashnode.com/@amal) Thanks for pointing this out :)
