python中如何清空列表
1、
>>> a = ["aa","bb","cc","dd"] ## 生成列表
>>> a
['aa', 'bb', 'cc', 'dd']
>>> a = [] ## 清空列表
>>> a
[]
2、
>>> a = ["aa","bb","cc","dd"] ## 生成列表
>>> a
['aa', 'bb', 'cc', 'dd']
>>> for i in range(len(a)):
a.pop() ## 清空列表
'dd'
'cc'
'bb'
'aa'
>>> a
[]