我和你,或许分开才是最好的选择,那些曾经的过客,就当做最美丽的风景线,在以后的以后,我会好好坚强。
本文实例讲述了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追加元素到列表的方法请关注haodaima.com其它相关文章!