Python Remove First Element from List Example
Today, how to remove first element from list in python is our main topic. you'll learn python list remove first element. we will help you to give example of python list remove one element. you will learn python list delete first element.
I'll offer you two examples in this case. one employing Python's "del" function and another using an array's "pop" function. we will pass first key and it will remove first element from array in python. so let's see below examples.
So let's see bellow example:
myArray = ['one', 'two', 'three', 'four', 'five'] # Remove First Element myArray.pop(0) print(myArray)Output
['two', 'three', 'four', 'five']
myArray = [1, 2, 3, 4, 5, 6] # Remove First Element del myArray print(myArray)Output
[2, 3, 4, 5, 6]
It will help you....
Happy Pythonic Coding!