Computer Science

Suppose a tuple T is declared as T = (10, 12, 43, 39), which of the following is incorrect ?

  1. print(T[1])
  2. T[2] = -29
  3. print(max(T))
  4. print(len(T))

Python Tuples

2 Likes

Answer

T[2] = -29

Reason — Tuples are immutable. Hence we cannot perform item-assignment in tuples.

Answered By

1 Like


Related Questions