0% found this document useful (0 votes)
3 views4 pages

06 Tuple

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

06 Tuple

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Tuple

 A tuple is a collection which is ordered and unchangeable.


 The important elements of the list syntax are:
o the round brackets/parentheses,
o the commas between elements, and
o the names in quotes.
 thistuple = ("apple", "banana", "cherry")
 List are changeable(mutable) and tuple are unchangeable
(immutable). That is the most important difference between the two
data types.
List
 List items are ordered, changeable, and allow duplicate
values.
 The important elements of the list syntax are:
• the square brackets,
• the commas between elements, and
• the names in quotes.
 thislist = ["apple", "banana", "cherry", "apple", "cherry"]
Cont…

 Tuples are a Python data structure that is similar to lists but with a
different syntax. The elements of a tuple are enclosed in parentheses
instead of square brackets.
 Tuples are immutable, which means that once they are created, their
elements cannot be changed. This is different from lists, which are
mutable and can have elements added, removed, or modified.
 Tuples are more efficient than lists for the computer to use,
particularly in larger programs.
Understanding the Tuple Data Type

You might also like