代码示例:(标识:python_list_clear)
python_list_clear.py
thislist = ["apple", "banana", "cherry"]
thislist.clear()
print(thislist)
运行结果: