Class 11 CS Chapter 11 List Manipulations Solutions Sumita Arora New Syllabus / Uncategorized / By Neha Exercise 11.1 1. Why are lists called mutable types ? ...click here for answer 2 . What are immutable counterparts of lists ? ...click here for answer 3. What are different ways of creating lists ? ...click here for answer 4. What values can we have in a list? Do they all have to be the same type? ...click here for answer 5. How are individual elements of lists are accessed and changed ? ...click here for answer 6. How do you create the following lists ? ...click here for answer 8. Can you change an element of a sequence? What if the sequence is a string? What if the sequence is a list? ...click here for answer 9. What does a + b amounts to if a and b are lists ? ...click here for answer 11. What does a+b amount to if a is a list and b = 5 ? ...click here for answer 12. Is a string the same as a list of characters ? The meaning ...click here for answer 14. What is the difference between append() and insert() methods of list ? ...click here for answer 15. What is the difference between pop( ) and remove() methods of list? ...click here for answer 16. What is the difference between append( ) and extend() methods of list? ...click here for answer 17. How does the sort() work? Give example. ...click here for answer 18. What does list.clear( ) function do ? ...click here for answer 13. Which functions can you use to add elements to a list ? ...click here for answer 7. If a = (5, 4, 3, 2, 1, 0) evaluate the following expressions : ...click here for answer Back Exercise Part A 1. Discuss the utility and significance of Lists, briefly. ...click here for answer 3. Start with the list [8, 9, 10]. Do the following using list functions : ...click here for answer 6. What’s the purpose of the del operator and pop method ? Try deleting a slice. ...click here for answer 7. What does each of the following expressions evaluate to ? Suppose that L is the list ...click here for answer 8. What are list slices ? What for can you use them ? ...click here for answer 9. Does the slice operator always produce a new list ? ...click here for answer 10. Compare lists with strings. How are they similar and how are they different ? ...click here for answer 11. What do you understand by true copy of a list ? How is it different from shallow copy ? ...click here for answer 12. An index out of bounds given with a list name causes error, but not with list slices. Why ? ...click here for answer 4. What do you understand by mutability ? What does “in place” task mean ? ...click here for answer 6. What’s a [1 : 1] if a is a string of at least two characters ? And what if string is shorter ? ...click here for answer 12. If a is (1, 2, 3) ...click here for answer Back Exercise Part B 1. What is the difference between following two expressions, if lst is given as [1, 3, 5] ...click here for answer 2. Given two lists LI = ...click here for answer 4. Given a list LI = [3, 4.5, 12, 25.7, [2, 1, 0, 5], 88] ...click here for answer 5. Given a list L1 = [3, 4.5, 12, 25.7, ]2, 1, 0, 5], 88], which function can change the list to : ...click here for answer 6. What will the following code result in ? ...click here for answer 7. Predict the output ...click here for answer 8. Predict the output ...click here for answer 10. Predict the output ...click here for answer 11 . Predict the output of following two parts. Are the outputs same? Are the outputs different? Why? ...click here for answer 12 . Find the errors ...click here for answer 13. Find the errors ...click here for answer 14. Find the errors ...click here for answer 15. What will be the output of following code ? ...click here for answer Back Exercise Part C 2 . Write a program that inputs two lists and creates a third, that contains all elements of the first followed by all elements of the second. ...click here for answer 8. Write a program that reads the n to display nth term of Fibonacci series. ...click here for answer 9. Write programs as per following specifications ...click here for answer 6. Write a program that takes any two lists L and M of the same size and adds their elements together to form a new list N whose elements are sums of the corresponding elements in L and M. For instance, if L = [3 ,1,4] and M – [1,5,9], then N should equal [4,6,13]. # Code ...click here for answer 5. Create the following lists using a for loop : ...click here for answer 3. Ask the user to enter a list containing numbers between 1 and 12. Then replace all of the entries in the list that are greater than 10 with 10. ...click here for answer 4. Ask the user to enter a list of strings. Create a new list that consists of those strings with their first characters removed. ...click here for answer 7. Write a program that rotates the elements of a list so that the element at the first index moves to the second index, the element in the second index moves to the third index, etc., and the element in the last index moves to the first index. # Code ...click here for answer