> For the complete documentation index, see [llms.txt](https://r24zeng.gitbook.io/leetcode-notebook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://r24zeng.gitbook.io/leetcode-notebook/useful-knowledge-about-python/initialize-list-in-python.md).

# Initialize list in Python

nums\[0, 0, 0, 0, 0], have n 0

* `nums = [0, ] * n`

nums\[m]\[n], all elements are 0

* `nums = [[0] * n for i in range(m)]`
