Computer Science
Discuss the utility and significance of tuples, briefly.
Python Tuples
15 Likes
Answer
Tuples are used to store multiple items in a single variable. It is a collection which is ordered and immutable i.e., the elements of the tuple can't be changed in place. Tuples are useful when values to be stored are constant and need to be accessed quickly.
Answered By
11 Likes
Related Questions
State whether the following statement is True or False :
All tuple functions work identically with nested tuples.
State whether the following statement is True or False :
Functions max( ) and min( ) work with all types of nested tuples.
If a is (1, 2, 3)
- what is the difference (if any) between a * 3 and (a, a, a) ?
- Is a * 3 equivalent to a + a + a ?
- what is the meaning of a[1:1] ?
- what is the difference between a[1:2] and a[1:1] ?
Does the slice operator always produce a new tuple ?