0% found this document useful (0 votes)
3 views1 page

Python Questions

The document outlines the properties of Python lists, highlighting that they are ordered, mutable, heterogeneous, and allow duplicates. It provides examples demonstrating each property, such as maintaining insertion order and the ability to store different data types. Additionally, it shows how lists can be modified after creation and can contain repeated values.

Uploaded by

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

Python Questions

The document outlines the properties of Python lists, highlighting that they are ordered, mutable, heterogeneous, and allow duplicates. It provides examples demonstrating each property, such as maintaining insertion order and the ability to store different data types. Additionally, it shows how lists can be modified after creation and can contain repeated values.

Uploaded by

omshree chinee
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

---------> PYTHON QUESTIONS <---------

Python sequences (OMDH)


List: ordered, mutable, duplicates, heterogeneous
Python List Properties
Ordered → Items maintain their insertion order.
 a = [10, 20, 30]
 print(a[0]) # 10 (first item is preserved)
Mutable → You can change, add, or remove elements after creation.
 a[1] = 99
 print(a) # [10, 99, 30]
Heterogeneous → Can store different data types together.
 a = [1, "hello", 3.14, True]
Allows duplicates → Same value can appear multiple times.
 a = [1, 2, 2, 3, 3, 3]
 print(a) # [1, 2, 2, 3, 3, 3]

You might also like