python如何创建一个空表以及有三个整数1,32,2的列表

Python017

python如何创建一个空表以及有三个整数1,32,2的列表,第1张

How to create an empty list using square brackets [].

如何使用方括号[]创建一个空列表

How to create an empty list using list().

如何使用list()创建一个空列表。

Their use cases.

他们的用例。

How efficient they are (one is faster than the other!). We will use the timeit module to compare them.

它们的效率(一个比另一个快!)。 我们将使用timeit模块进行比较。

Let's begin!