MENU
Question -

What is tuple ?



Answer -

Tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists.
The only difference is that tuples can’t be changed i.e.,tuples are immutable and tuples use parentheses and lists use square brackets. Creating a tuple is as simple as putt ing different comma- separated values and optionally you can put these comma-separated values between parentheses also.
For example :
tup1 = (‘physics’, ‘chemistry’, 1997, 2000);
tup2 = (1,2, 3,4, 5);
tup3 = “a”, “b”, “c”, “d”;

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×