Important Notice:

Course Content
List Manipulation in Python (Chapter-7) M3-R5
About Lesson
List:-

       Python में ‘List’ data structure होता है List Elements का sequence होता है और mutable(changeable)  होता है Python के list में जो elements होते है उसे ‘items’ कहते है List के हर item को comma(,) से seperate किया जाता है और पूरे items को square brackets([]) के अन्दर close किया जाता है List में mixed data types भी use किया जा सकते है।

Example:                     l=[1,2,3,4,5,6]             print(l)             print(type(l))

Note:- 1. List data type heterogeneous element allow करता है

2. list data type insertion order को follow करता है अर्थात जिस order में data input करेंगें उसी order में data print होगी।

3. list data mutable object create करता है अर्थात वह अपने content में modification करने की अनुमति देता है।

4. list datatype growable datatype है अर्थात list में exist element की size या संख्या को increase या decrease किया जाता है।

5. list support both positive & Negative indexing.

 list1 = [1, 2, 3, 4, 5]                         #Integer List

list2 = [1.5, 2.4, 3.8, 4.4, 5.7];           #Float List

list3 = [1, 2, “Hello”, 4.5];                   #Mixed Data Types List

list4 = [1, 2, [1, 2], 4.5]                       #Nested List

 

List:-

     Python has ‘List’ data structure. List elements have a sequence and are mutable (changeable). The elements in Python’s list are called ‘items’. Every item in the list is separated with comma (,). And the entire items are closed inside square brackets ([]). Mixed data types can also be used in the list.

Example:                     l=[1,2,3,4,5,6]             print(l)             print(type(l))

Note:- 1. List data type allow heterogeneous element

2. The list data type follows the insertion order, that is, the data will be printed in the order in which you input the data.

3. List data creates mutable object, that is, it allows modification in its content.

4. List data creates mutable object, that is, it allows modification in its content.

5. list support both positive & Negative indexing.

 list1 = [1, 2, 3, 4, 5]                                #Integer List

list2 = [1.5, 2.4, 3.8, 4.4, 5.7];                 #Float List

list3 = [1, 2, “Hello”, 4.5];                       #Mixed Data Types List

list4 = [1, 2, [1, 2], 4.5]                           #Nested List

error: Content is protected !!