0% found this document useful (0 votes)
9 views2 pages

Python List Tuple Dictionary Differences

The document outlines the differences between Python data structures: Lists, Tuples, and Dictionaries. It compares features such as definition, mutability, brackets used, performance, modification, data storage, access methods, and order. Each structure is illustrated with examples for clarity.
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)
9 views2 pages

Python List Tuple Dictionary Differences

The document outlines the differences between Python data structures: Lists, Tuples, and Dictionaries. It compares features such as definition, mutability, brackets used, performance, modification, data storage, access methods, and order. Each structure is illustrated with examples for clarity.
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

Python Data Structure Differences (CBSE Class 12 Computer Science)

List vs Tuple
Feature List Tuple

Definition Ordered collection of items Ordered collection of items

Mutability Mutable (can be changed) Immutable (cannot be


changed)

Brackets Used [] ()

Performance Slightly slower Faster than lists

Modification Items can be added or Items cannot be modified


removed

Example numbers = [1,2,3] numbers = (1,2,3)

List vs Dictionary
Feature List Dictionary

Data Storage Stores items in sequence Stores key–value pairs

Brackets Used [] {}

Access Method Using index numbers Using keys

Order Ordered Ordered (Python 3.7+)

Example [10,20,30] {'name':'Ashwin','marks':95}

Tuple vs Dictionary
Feature Tuple Dictionary

Structure Ordered collection of values Collection of key–value


pairs

Mutability Immutable Mutable

Brackets () {}

Access By index By key

Example (10,20,30) {'a':10,'b':20}

You might also like