Data Types and Variables – Multiple Choice Questions (MCQs)
-
-
38. Which of the following is a valid way to create a shallow copy of a list `my_list`?
-
39. What will be the output of `print(type('hello'))`?
-
40. Which method is used to add multiple elements to a list?
-
41. What will be the output of `print(type(True))`?
-
42. Which method is used to insert an element at a specific index in a list?
-
43. What will be the output of `print(type([1, 2]))`?
-
44. Which method is used to remove the first occurrence of a specific element from a list?
-
45. What will be the output of `print(type((1, 2)))`?
-
46. Which method is used to clear all elements from a list?
-
47. What will be the output of `print(type({'a': 1}))`?
-
48. Which method is used to get all keys from a dictionary?