How to Remove First Element from List in Python?

By Hardik Savani October 30, 2023 Category : Python


Here, I will show you how to works python list delete first element. This article will give you simple example of python list remove first element. I would like to share with you python list remove one element. you will learn python list remove first n elements.

In this example, I will give you two examples. one using "del" in python and another using "pop" function of array. we will pass first key and it will remove first element from array in python. so let's see below examples.

You can use these examples with python3 (Python 3) version.

let's see below simple example with output:

Example 1:

myArray = ['one', 'two', 'three', 'four', 'five']
# Remove First Element


['two', 'three', 'four', 'five']

Example 2:

myArray = [1, 2, 3, 4, 5, 6]
# Remove First Element
del myArray[0]


[2, 3, 4, 5, 6]

I hope it can help you...

Tags :