0% found this document useful (0 votes)
13 views

CP Python List Tuple Sets and Dictionary

The document discusses the differences between lists, tuples, sets, and dictionaries in Python. It explains that lists are mutable and ordered collections that can contain duplicate data. Tuples are similar to lists but are immutable. Sets only contain unique elements. Dictionaries store data in key-value pairs and do not allow duplicate keys.

Uploaded by

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

CP Python List Tuple Sets and Dictionary

The document discusses the differences between lists, tuples, sets, and dictionaries in Python. It explains that lists are mutable and ordered collections that can contain duplicate data. Tuples are similar to lists but are immutable. Sets only contain unique elements. Dictionaries store data in key-value pairs and do not allow duplicate keys.

Uploaded by

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

Computer

Programming
Differences between list , tuple, set &
dictionary
List
• Lists are one of the most commonly used data structures provided by
python; they are a collection of iterable , mutable and ordered data. They
can contain duplicate data.
• The list can be represented by []
Example:-
• Output:-
Tuple
• Tuples are similar to lists. This collection also has iterable, ordered, and
(can contain) repetitive data, just like lists. But unlike lists, tuples are
immutable.
• Tuple can be represented by ().
• example:-

output:-
Set
• Set is another data structure that holds a collection of unordered, iterable
and mutable data. But it only contains unique elements.
• Set can be represented by {}.
example:-
output:-
Dictionary
• Dictionaries are used to store data values in key : value
pairs.
• A dictionary is a collection which is ordered, changeable
and do not allow duplicates.
• The dictionary can be represented by {}.

output:-
Collection VS
Mutable Ordered Indexing Duplicate Data
Features

List

Tuple 𐄂

Set 𐄂 𐄂 𐄂

Dictionary 𐄂
Thank You.

You might also like