Python List First N Element

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

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