Append element to a list : List Append « List « Python






Append element to a list

Append element to a list
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

           
       








Related examples in the same category

1.Adding Elements to ListsAdding Elements to Lists
2.List append(x)List append(x)
3.List: The Difference Between Extend and AppendList: The Difference Between Extend and Append