May 2017
Intermediate to advanced
280 pages
6h 2m
English
If you are confused between the append and extend methods, the following example will clear your doubts:
>>> Linux = ["kali", "Ubuntu", "debian"]>>> Linux2 = ["RHEL", "Centos"]>>> Linux.extend(Linux2)>>> Linux['kali', 'Ubuntu', 'debian', 'RHEL', 'Centos']>>>>>>>>> Linux = ["kali", "Ubuntu", "debian"]>>> Linux2 = ["RHEL", "Centos"]>>> Linux.append(Linux2)>>> Linux['kali', 'Ubuntu', 'debian', ['RHEL', 'Centos']]>>>
The append method gives a list within the list. The list Linux2 = ["RHEL", "Centos"] has been taken as one list. Let's proceed to the next method.
Read now
Unlock full access