InterviewSolution
Saved Bookmarks
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Question 23: Find the output of the following program:L1 = [1, 2, 3, 4]L2 = L1L3 = L1.copy()L4 = L1L1[0] = [5]print(L1, L2, L3, L4)(A) [5, 2, 3, 4] [5, 2, 3, 4] [1, 2, 3, 4] [1, 2, 3, 4](B) [[5], 2, 3, 4] [[5], 2, 3, 4] [[5], 2, 3, 4] [1, 2, 3, 4](C) [5, 2, 3, 4] [5, 2, 3, 4] [5, 2, 3, 4] [1, 2, 3, 4](D) [[5], 2, 3, 4] [[5], 2, 3, 4] [1, 2, 3, 4] [[5], 2, 3, 4] |
| Answer» | |
| 2. |
Question 17: Find the output of the following program:data = [x for x in range(5)]temp = [x for x in range(7) if x in data and x%2==0]print(temp)(A) [0, 2, 4, 6](B) [0, 2, 4](C) [0, 1, 2, 3, 4, 5](D) Runtime error |
| Answer» | |
| 3. |
Question 21: Find the output of the following program:L1 = []L1.append([1, [2, 3], 4])L1.extend([7, 8, 9])print(L1[0][1][1] + L1[2])(A) Type Error(B) 12(C) 11(D) 38 |
| Answer» | |
| 4. |
Question 11: Find the output of the following program:list = [1, 2, 3, None, (1, 2, 3, 4, 5), ['Geeks', 'for', 'Geeks']]print(len(list))(A) 12(B) 11(C) 6(D) 22 |
| Answer» | |