Skip to content

Instantly share code, notes, and snippets.

@tcpdump-examples
Created March 5, 2022 13:43
Show Gist options
  • Save tcpdump-examples/a92c4974160ed9fb55fbd96332546463 to your computer and use it in GitHub Desktop.
Save tcpdump-examples/a92c4974160ed9fb55fbd96332546463 to your computer and use it in GitHub Desktop.

Revisions

  1. tcpdump-examples created this gist Mar 5, 2022.
    15 changes: 15 additions & 0 deletions python.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    how to get last element of a list in python
    ```
    list1 = [1, 2, 3, 4, 5]
    print(list1[len(list1)-1])
    5
    print(list1[-1])
    5
    print(list1.pop())
    5
    ```

    [how to get last element of a list in python](https://www.howtouselinux.com/post/get-last-element-of-a-list-in-python)