"task": "\n Let's deal with lists some more. There are many operations that can be performed on Lists. \n They are: \n 1. Checking whether the element exists in the list using 'in' keyword. \n 2. To determine length of the list using len() \n 3. To add items using append() \n 4. To insert at specific index using insert() \n 5. To remove a particular element using remove(element) \n 6. Pop() - Removes at specified index or by default, the last one. \n 7. del keyword removes the specified index. \n 8. clear() - Empties the whole list. \n Here's your task.(Quite a hectic task!) \n\n Task 22 \n Create a list with the values 'one', 'two', 'three'. Your task is to do the following: \n 1. Search for the element one and print 'Found!' if found, else print 'Not Found!' \n 2. Print the length of the list \n 3. Add 'four' to the list using append() \n 4. Insert 'five' at index 1 using insert() \n 5. Remove 'one' from the list using remove() \n 6. Remove the value at index 0 using pop() \n 7. Delete the second element of the list using del \n 8. Empty the remaining list and print 'Empty!' \n Use a function display() to display the list after each and every operation.",
0 commit comments