Course Name: Python for Trading: Basic, Section No: 4, Unit No: 4, Unit type: Notebook
Pop and Index takes and returns one element. What is the code for taking two or more arguments in these keywords?
Hi Jeyaraman
These are inbuilt Python data structures. The methods pop and index for the list are inbuild and cannot take multiple arguments. If you wish to find the index of or remove multiple elements you would have to use a for loop. This article will walk you through removing multiple items from a list. You can adapt the same to find the index for multiple items.
Hope this helps.