🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

मान लीजिए t=(1, 2, 4, 3), तो निम्नलिखित में से कौन सा गलत है?

Suppose t = (1, 2, 4, 3), which of the following is incorrect?

A)
B)
C)
D)

Explanation:

Let's break down the options for the given tuple t = (1, 2, 4, 3):

  • (A) print(t[3]): This is correct. Indexing starts from 0, so t[3] refers to the fourth element, which is 3. This will print 3.

  • (B) t[3] = 45: This is incorrect. Tuples are immutable in Python, meaning their elements cannot be changed after creation. Attempting to modify t[3] will result in a TypeError.

  • (C) print(max(t)): This is correct. The max() function returns the largest element in the tuple. Here, the largest element is 4, so it will print 4.

  • (D) print(len(t)): This is correct. The len() function returns the number of elements in the tuple. Here, the length of t is 4, so it will print 4.

Answer:

The incorrect statement is:

(B) t[3] = 45

Latest Updates