English

Differentiate between tuple and list.

Advertisements
Advertisements

Question

Differentiate between tuple and list.

Distinguish Between
Advertisements

Solution

List Tuple
A list is a sequence of values of any type. A tuple is a sequence of values of any type.
It is enclosed in square brackets []. It is enclosed in parentheses ().
It is mutable; values in the list can be modified. It is immutable; values of tuples cannot be changed in place.
List methods include append(), extend(), insert(), remove(), sort() and reverse(). Tuple functions include len(), max(), min() and tuple().
Example: [10, 20, 30] Example: (10, 20, 30)
shaalaa.com
  Is there an error in this question or solution?
Chapter 1: Review of Phython - EXERCISE [Page 27]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 1 Review of Phython
EXERCISE | Q 26. | Page 27
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×