Q. What is the output of the following code?

Code:
x = (1, 2, 3)
x[0] = 5
  • (A) (5, 2, 3)
  • (B) Error
  • (C) (1, 2, 3)
  • (D) (1, 5, 3)
πŸ’¬ Discuss
βœ… Correct Answer: (B) Error
Explanation: Tuples are immutable, so their elements cannot be modified.
Explanation by: Ankit Singh
Tuples are immutable, so their elements cannot be modified.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
94
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ankit Singh
Publisher
πŸ“ˆ
84%
Success Rate