What is the difference between Python’s list methods append and extend? April 23, 2022 by Tarik Billa append appends object at the end. >>> x = [1, 2, 3] >>> x.append([4, 5]) >>> print(x) [1, 2, 3, [4, 5]] extend extends list by appending elements from the iterable. >>> x = [1, 2, 3] >>> x.extend([4, 5]) >>> print(x) [1, 2, 3, 4, 5] Browse More Popular Posts Single role multiple IP addresses in Spring Security configuration How to run an activity only once like Splash screen How do I access local C variable in arm inline assembly? Using .Net what limitations (if any) are there in using the XmlSerializer? Don’t wrap text in Android TextView at period in abbreviation Why are all my C++ programs exiting with 0xc0000139? regex to split line (csv file) OpenQA.Selenium.WebDriverException: ‘Cannot start the driver service on http://localhost:20548/’ How to get the starting/base address of a process in C++? annotate boxplot in ggplot2 simple xml add namespaced child database.yml &references not working numpy.sum() giving strange results on large arrays Merging xml file using java NodeList Simple for() loop benchmark takes the same time with any loop bound Variable Sized Arrays vs calloc in C Definition of global variables using a non constant initializer matlab multiple x axis one below another MySQL Auto increment primary key increases by 10 Why does int32.maxvalue + 1 overflow a long?