手机
当前位置:查字典教程网 >脚本专栏 >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判断windows隐藏文件的方法

python del()函数用法

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

python的正则表达式re模块的常用方法

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

python解决字典中的值是列表问题的方法

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

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

python 字典(dict)遍历的四种方法性能测试报告

python查找第k小元素代码分享

精品推荐
分类导航