We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Basic Data Types
- Lists
- Discussions
Lists
Lists
Sort by
recency
|
2821 Discussions
|
Please Login in order to post a comment
Hi guys, This is the solution I thought of. Here, the commands must be taken iteratively as input. for that, we can use input().split() after a for loop, where the split() command stores the command line entered as a list!
if command is stored as list, for example, ['insert', '0'] command would mean insert operation with 0 value. so we assign the 0th position of the command line as operation. then we convert the value to integer as the value to be added to new list is a number!
here is the code:
Spoiler