google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 list in python mcq class 11 | list in python mcq questions - 2nd puc computer science

list in python mcq class 11 | list in python mcq questions

class 11 list mcq,lists in python mcq,list in python mcq class 11,list in python mcq questions,list mcq class 11,list manipulation class 11 mcq,list in pythin class 11 mcq,list mcq class 11,list comprehension in python mcq,list manipulation in python mcq,class 11 list manipulation mcq,class 11 ip list mcq,mcq on list in python class 11,Mcq on list in python class 11 with answers,Mcq on list in python class 11 with answers pdf,Mcq on list in python class 11 pdf,Mcq on list in python class 11 pdf download,mcq on list,mcq on list in python,MCQ on lists in Python

1. Which of the following is a valid way to create a list in Python?





ANSWER= B) [2, 4, 6, 8, 10, 12]

2. Lists in Python are:





ANSWER= C) Mutable

3. What will be the output of the following code? Python Code: list1 = [2, 4, 6, 8, 10, 12] print(list1[3])





ANSWER= D) 8

4. How are elements of a list separated?





ANSWER= A) Comma

5. Which data types can a list contain?





ANSWER= C) Mixed data types

6. What does the `+` operator do when applied to two lists?





ANSWER= B) Concatenates them

7. What will be the output of the following code? Python Code: list1 = [1, 2, 3] list2 = [4, 5, 6] print(list1 + list2)





ANSWER= A) [1, 2, 3, 4, 5, 6]

8. Which operator is used for list repetition?





ANSWER= B) *

9. What will be the output of the following code? Python Code: list1 = ['Hello'] print(list1 * 3)





ANSWER= D) ['Hello', 'Hello', 'Hello']

10. Which of the following checks if an element is in a list?





ANSWER= A) in

11. What will be the output of the following code? Python Code: list1 = ['Red', 'Green', 'Blue', 'Yellow'] print(list1[1:3])





ANSWER= C) ['Green', 'Blue']

12. How do you access the last element of a list?





ANSWER= B) list1[-1]

13. What does the slicing operation list1[2:5] return? Python Code: list1 = ['Red', 'Green', 'Blue', 'Yellow', 'Black']





ANSWER= D) ['Blue', 'Yellow', 'Black']

14. What will be the output of the following code? Python Code: list1 = ['Red', 'Green', 'Blue', 'Yellow'] print(list1[::2])





ANSWER= A) ['Red', 'Blue']

15. What will be the output of the following code? Python Code: list1 = ['Red', 'Green', 'Blue', 'Yellow'] print(list1[::-1])





ANSWER= B) ['Yellow', 'Blue', 'Green', 'Red']

16. What does the `append()` method do?





ANSWER= C) Adds an element at the end of the list

17. What will be the output of the following code? Python Code: list1 = [1, 2, 3] list1.append(4) print(list1)





ANSWER= A) [1, 2, 3, 4]

18. What does the `extend()` method do?





ANSWER= B) Extends the list with another list

19. What will be the output of the following code? Python Code: list1 = [1, 2, 3] list2 = [4, 5] list1.extend(list2) print(list1)





ANSWER= D) [1, 2, 3, 4, 5]

20. What does the `insert()` method do?





ANSWER= C) Inserts an element at a specified position

21. Which loop is used to traverse through a list in Python?





ANSWER= D) both for and while loop

22. What will be the output of the following code? Python Code: list1 = ['Red', 'Green', 'Blue'] for item in list1: print(item)





ANSWER= A) Red\nGreen\nBlue

23. How can you access each element of a list using its index?





ANSWER= B) Using range() and len()

24. What will be the output of the following code? Python Code: list1 = ['Red', 'Green', 'Blue'] for i in range(len(list1)): print(list1[i])





ANSWER= C) Red\nGreen\nBlue

25. How does a while loop traverse through a list?





ANSWER= B) By using an index counter

26. What does the `remove()` method do?





ANSWER= C) Removes the first occurrence of a specified value

27. What will be the output of the following code? Python Code: list1 = [1, 2, 3, 4, 3] list1.remove(3) print(list1)





ANSWER= A) [1, 2, 4, 3]

28. What does the `pop()` method do?





ANSWER= C) Removes and returns the last element

29. What will be the output of the following code? Python Code: list1 = [1, 2, 3, 4] print(list1.pop())





ANSWER= A) 4

30. What does the `clear()` method do?





ANSWER= B) Removes all elements from the list

31. What does the `len()` function return?





ANSWER= C) The number of elements in the list

32. What does the `sum()` function return when applied to a list of numbers?





ANSWER= A) The sum of all elements

33. How do you find the maximum value in a list?





ANSWER= D) Using the max() function

34. What will be the output of the following code? Python Code: list1 = [1, 2, 3, 4] print(max(list1))





ANSWER= B) 4

35. How do you find the minimum value in a list?





ANSWER= C) Using the min() function

36. What will be the output of the following code? Python Code: list1 = [1, 2, 3, 4] print(min(list1))





ANSWER= C) 1

37. How do you sort a list in ascending order?





ANSWER= D) Using the sort() method

38. What will be the output of the following code? Python Code: list1 = [4, 3, 2, 1] list1.sort() print(list1)





ANSWER= A) [1, 2, 3, 4]

39. How do you sort a list in descending order?





ANSWER= C) Using the sort() method with reverse=True

40. What will be the output of the following code? Python Code: list1 = [1, 2, 3, 4] list1.sort(reverse=True) print(list1)





ANSWER= D) [4, 3, 2, 1]

41. How can you create a 2D list in Python?





ANSWER= A) Using nested lists

42. What will be the output of the following code? Python Code: list1 = [[1, 2], [3, 4], [5, 6]] print(list1[1][1])





ANSWER= B) 4

43. How do you access the first element of the second list in a nested list?





ANSWER= D) list1[1][0]

44. What will be the output of the following code? Python Code: list1 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] print(list1[2])





ANSWER= C) [7, 8, 9]

45. How do you flatten a 2D list using list comprehension?





ANSWER= A) [item for sublist in list1 for item in sublist]

1st puc computer science chapter 9 lists mcq
list in python mcq class 11 | list in python mcq questions list in python mcq class 11 | list in python mcq questions Reviewed by Vision Academy on September 22, 2024 Rating: 5

No comments:

CheckOut

Powered by Blogger.