Computer Science

If tup = (20, 30, 40, 50), which of the following is incorrect?

  1. print (tup[3])
  2. tup[2] = 56
  3. print (max(tup))
  4. print (len(tup))

Python Tuples

1 Like

Answer

tup[2] = 56

Reason — Tuples in Python are immutable. Therefore, attempting to assign a new value to an existing element, such as tup[2] = 56, will result in an error.

Answered By

1 Like


Related Questions