Join Regular Classroom : Visit ClassroomTech

Python List – remove the first value of a List

remove method – list.remove(list[index])

Here is an example for you

# Python code to understand how to remove the first value of a List
# www.codewindow.in

b=[10,11,12,13,14]

#using remove method
b.remove(b[0])
print(b)

Output:

[11, 12, 13, 14]

Explanation:

Here, remove(b[0]) removes the element indexed at 0 i.e. the first element.


You Missed

Also Checkout