手机
当前位置:查字典教程网 >脚本专栏 >python >python追加元素到列表的方法
python追加元素到列表的方法
摘要:本文实例讲述了python追加元素到列表的方法。分享给大家供大家参考。具体实现方法如下:scores=["1","2","3"]#addas...

本文实例讲述了python追加元素到列表的方法。分享给大家供大家参考。具体实现方法如下:

scores = ["1","2","3"] # add a score score = int(raw_input("What score did you get")) scores.append(score) # list high-score table for score in scores: print score

运行结果如下:

What score did you get?: 5 1 2 3 5

希望本文所述对大家的Python程序设计有所帮助。

【python追加元素到列表的方法】相关文章:

Python通过解析网页实现看报程序的方法

python正则分组的应用

python中使用urllib2伪造HTTP报头的2个方法

2款Python内存检测工具介绍和使用方法

Python GAE、Django导出Excel的方法

python list 合并连接字符串的方法

python del()函数用法

python实现的各种排序算法代码

python下如何让web元素的生成更简单的分析

wxpython 最小化到托盘与欢迎图片的实现方法

精品推荐
分类导航