🧠 Python Trick Question x = (1, 2, 3) x[0] = 10 What will happen? 🤔 A: (10, 2, 3) B: Error C: None D: (1, 2, 3) 👇 Think before scrolling 👉 Answer: Error Because tuples are immutable. 🚀 Basics clear = strong foundation #Python #CodingChallenge #Developers #Programming #Learning
Tuple's nature is immutable, which causes code to crash, so the answer is B - Error
Error, as tuple is an immutable data type means it cannot be changed hence the code won't work returning error
That first bracket makes it tuple instead of array having square brackets, thereby the content remains unchanged or immutable. Any attempt to change the nature of tuple will cause the code erroneous. Hence, B.
Error because tuple is immutable
Error Because tuple is immutable
Error tuple is immutable
B: Error Because Tuple's Nature Is Immutable..
B. Error.
B. Error because type error
“Did you get it right?”