Answers for "declare list in python with size"

12

python initialize list length n

Creating an empty list:

>>> l = [None] * 10
>>> l
[None, None, None, None, None, None, None, None, None, None]
Posted by: Guest on February-07-2020
0

creating a list of size n in python

>>> my_list = [None] * 10
>>> my_list
[None, None, None, None, None, None, None, None, None, None]
Posted by: Guest on April-12-2021

Code answers related to "declare list in python with size"

Python Answers by Framework

Browse Popular Code Answers by Language