πŸ“Š Python
Q. What is the output of this code snippet?
Code:
x = [1, 2, 3]
print(x[-1])
  • (A) 1
  • (B) 3
  • (C) Error
  • (D) None
πŸ’¬ Discuss
βœ… Correct Answer: (B) 3

Explanation: Negative indices access elements from the end; -1 refers to the last element.

Explanation by: Mr. Dubey
Negative indices access elements from the end; -1 refers to the last element.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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