手机
当前位置:查字典教程网 >脚本专栏 >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 GAE、Django导出Excel的方法

python高并发异步服务器核心库forkcore使用方法

python del()函数用法

Python生成pdf文件的方法

python去掉字符串中重复字符的方法

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

Python操作列表的常用方法分享

python 实现插入排序算法

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

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

精品推荐
分类导航