créer une liste d'une certaine longueur python
# 2.X only. Use list(range(10)) in 3.X.
>>> l = range(10)
>>> l
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Poised Pigeon
# 2.X only. Use list(range(10)) in 3.X.
>>> l = range(10)
>>> l
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
#a list
cars = ['Ford', 'Volvo', 'BMW', 'Tesla']
#some updates on list
cars.append('Honda')
cars.append('Tata')
#find length of list
length = len(cars)
print('Length of the list is :', length)
6
li = [None] * 5 # [None, None, None, None, None]
li = [0] * 5 # [0, 0, 0, 0, 0]
#declaring a list/array with size 10
L = [None] * 10
print('list_xxx : ' + str(len(list_xxx)))