Answers for "how to create python list"

1

create python list

pythonCopyl = []		# empty list
l = [2, 4, 6, 8]		# elements of same data type
l = [2, 'Python', 1+2j]		# elements of different data type
Posted by: Guest on October-25-2021
3

how to make a list python

list = ['list element', 'list element']
# or t obe more effecient:
import numpy #if you do not have numpy, do "pip install numpy"
numpyarray = numpy.array(['array element', 'array element'])
#a numpy array is faster than a standard list
Posted by: Guest on December-28-2020

Code answers related to "how to create python list"

Python Answers by Framework

Browse Popular Code Answers by Language