Python List Last N Element

February 24, 2019
nums = [1, 2, 3, 4, 5]

nums[-2:] # [4, 5]
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.