79.3k views
15 votes
Which function works best when you need to remove an element at a specific index in a list?

User Danja
by
6.0k points

1 Answer

9 votes

Answer:

You can use the pop() method to remove specific elements of a list. pop() method takes the index value as a parameter and removes the element at the specified index. Therefore, a[2] contains 3 and pop() removes and returns the same as output.

Step-by-step explanation:

Hope it helps you!

User Benjamin Breton
by
5.4k points