πŸ“Š Python
Q. What will be the output of the following code?
Code:
x = [1, 2, 3]
print(x[1])
  • (A) 1
  • (B) 2
  • (C) 3
  • (D) IndexError
πŸ’¬ Discuss
βœ… Correct Answer: (B) 2

Explanation: Lists are zero-indexed, so `x[1]` returns the second element, which is `2`.

Explanation by: Mr. Dubey
Lists are zero-indexed, so `x[1]` returns the second element, which is `2`.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
163
Total Visits
πŸ“½οΈ
8 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
88%
Success Rate