本站改版新增arduino频道

Micropython
Arduino

micropython 清空列表


清空列表

定义一个列表,并清空列表,可以使用 clear() 方法实现。

实例 1
RUNOOB = [6, 0, 4, 1]
print('清空前:', RUNOOB)  
 
RUNOOB.clear()
print('清空后:', RUNOOB)  
以上实例输出结果为:

清空前: [6, 0, 4, 1]
清空后: []



推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 ESP56.com All Rights Reserved
晋ICP备14006235号-22 晋公网安备14108102001165号

执行时间: 0.0094809532165527 seconds