List Manipulation Preeti Arora Class 11 IP Solution || List Manipulation Class 11 Solution || List Manipulation Class 11 IP Solution || List Manipulation Information Practices Solution || Preeti Arora List Manipulation Solution || List Manipulation Class 11 IP || List Manipulation Solution


Note :- Please Click on Question to get Solution of that question !!


Q1. What are the various ways to create a list?



Q2. What are the similarities between strings and lists?



Q3. Why lists are called mutable data type?



Q4. What the difference between insert() and append() methods of a list?



Q5. Suppose L = [10, ["few", "facts", "fun"], 3, 'Good']
Consider the above list and answer the following:
(i) L [3:]
(ii) L [:: 2]
(iii) L [1:2]
(iv) L [1] [1]




Q6. Find the output of the following:

L1 = [1, 2, 3]
L2 = [4, 5, 6]
print (L1+ list ("45"))
print (L1.pop())
L1.remove (2)
print (L1)
L1.extend (L2)
print (L2)




Q7. Write the output of the following:

import statistics
L = [20, 40, 50, 60, 20, 30, 40, 70]
Count = L.count (40)
print (count)
x = statistics.mean (L)
print(x)
L. sort ()
print (L)
L.reverse()
print (L)




Q8. Write the output of the following Python program code:

Str2 = list ("Cam@123*")
for i in range (len (Str2)-1):
    if i == 5:
        Str2[i] = Str2[i]*2
elif (Str2[i].isupper()):
    Str2[i] = Str2[i]*2
elif (Str2 [i].isdigit()):
    Str2 [i] = 'D'
print(Str2)




Q9. Write a program that takes an array S as an argument and add all the odd values and display the sum.



Q10. Write a program to calculate mean of a given list of numbers.




Q11. Write a program to calculate the minimum element of a given list of numbers.



Q12. Write a code to calculate and display total marks and percentage of a student from the given list storing marks of a student.



Q13. Write a program to multiply an element by 2 if it is odd index for a given list containing both number and strings.



Q14. Write a program to count the frequency of an element in a given list.



Q15. Write a program to shift elements of a list so that the first element moves to the second index and the second index moves to the third index, etc., and the last element shifts to the first position.

Suppose list is [10, 20, 30, 40]
After shifting it should look like: [20, 30, 40, 10]




Q16. An array Num contains the following elements:
3, 25, 13, 6, 35, 8, 14, 45
Write a function to swap the content with next value divisible by 5 so that the resultant array will look like:
25, 3, 13, 35, 6, 8, 45, 14

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post