Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to join two lists in python

#define lists
my_list = ["a", "b"]
other_list = [1, 2]

#extend my_list by adding all the values from other_list into my list
my_list.extend(other_list)

# output: ['a', 'b', 1, 2]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #join #lists #python
ADD COMMENT
Topic
Name
6+6 =