Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python array extend

my_list = ['a','b']  
my_list.append('c') 
print(my_list)      # ['a','b','c']

other_list = [1,2] 
my_list.append(other_list) 
print(my_list)      # ['a','b','c',[1,2]]

my_list.extend(other_list) 
print(my_list)      # ['a','b','c',[1,2],1,2]
Comment

how to extend an array python

my_list = ['geeks', 'for'] 
another_list = [6, 0, 4, 1] 
my_list.extend(another_list) 
Comment

PREVIOUS NEXT
Code Example
Python :: check if array is empty python 
Python :: matplotlib show plot 
Python :: # extract an email ID from the text using regex 
Python :: combination of 1 2 3 4 5 python 
Python :: add caption to plot python 
Python :: dictionary to list python 
Python :: catalan number 
Python :: python json check if key exists 
Python :: userregisterform 
Python :: how to make lists in python 
Python :: python count variable and put the count in a column of data frame 
Python :: python script as service linux 
Python :: keyboardinterrupt python 
Python :: pandas print a single row 
Python :: how to run python program in sublime text 3 windows 
Python :: python read file into variable 
Python :: difference between set and tuple in python 
Python :: check if year is leap python 
Python :: virtualenv python2 
Python :: django tempalte tag datetime to timestamp 
Python :: python sort the values in a dictionary 
Python :: Calculate Euclidean Distance in Python using norm() 
Python :: pow python 
Python :: class python 
Python :: how to convert dataframe to text 
Python :: how to push item to array python 
Python :: How to Merge train and Test dataset in python 
Python :: if substring not in string python 
Python :: python sort dict by value 
Python :: python keyboard key codes 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =