Answers for "how to initialize list of size n in python"

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 "how to initialize list of size n in python"

Python Answers by Framework

Browse Popular Code Answers by Language