Important Notice:

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

           पहले से उपलब्ध list को दूसरे reference variable को देते हैं तो इस process को aliasing कहते हैं।

a=[2,4,6,8]

b=a

print(a)                    # [2, 4, 6, 8]

print(b)                    # [2, 4, 6, 8]

aliasing list object में जब एक reference variable के element को change करते हैं, तो वे changes दूसरे reference variable को भी reflect करता है।

a=[2,4,6,8]

b=a

print(a)                         # [2, 4, 6, 8]

print(b)                         # [2, 4, 6, 8]

b[1]=10

print(a)                    # [2, 10, 6, 8]

print(b)                    # [2, 10, 6, 8]

 

Aliasing List Object:-

         When the already available list is given to another reference variable, this process is called aliasing.

a=[2,4,6,8]

b=a

print(a)                             # [2, 4, 6, 8]

print(b)                              # [2, 4, 6, 8]

When an element of one reference variable is changed in the aliasing list object, those changes are also reflected in the other reference variables.

a=[2,4,6,8]

b=a

print(a)                           # [2, 4, 6, 8]

print(b)                            # [2, 4, 6, 8]

b[1]=10

print(a)                        # [2, 10, 6, 8]

print(b)                        # [2, 10, 6, 8]

error: Content is protected !!