Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

append two items to list

my_list = ['a']
# You can use list.append(value) to append a single value:
my_list.append('b')
# my_list should look like ['a','b']

# and list.extend(iterable) to append multiple values.
my_list.extend(('b','c'))
# my_list should look like ['a','b','c']
Comment

add two list in python

list1 = ["a", "b" , "c"]
list2 = [1, 2, 3]

list1.extend(list2)
print(list1)
Comment

append two list of number to one python

listone = [1,2,3]
listtwo = [4,5,6]
mergedlist = []
mergedlist.extend(listone)
mergedlist.extend(listtwo)
Comment

PREVIOUS NEXT
Code Example
Python :: numpy random choice 
Python :: isinstance function python 
Python :: get file in file zip python 
Python :: how to find the path of a python module 
Python :: openai gym random action 
Python :: convert string to lowercase in python 
Python :: logical operators pandas 
Python :: python nested list 
Python :: create button in pyqt 
Python :: how to see the whole dataset in jupyterlab 
Python :: how to find lcm of 2 numbers in python 
Python :: blender show python version 
Python :: python using re trimming white space 
Python :: install json on python 
Python :: numpy randn with a shape of another array 
Python :: get output from transaction in brownie 
Python :: not equal python 
Python :: formula of factorial 
Python :: serialize keras model 
Python :: ForeignKey on delete django 
Python :: python dictionary sort by value then alphabetically 
Python :: python remove consecutive duplicates 
Python :: import flask session 
Python :: save to xlsx in python 
Python :: create forms in django 
Python :: python single line if 
Python :: python add strings 
Python :: range function 
Python :: how to remove time in datetime in python 
Python :: len function in python 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =