Delete an element from a list
scores = ["1","2","3"] # delete a score score = int(raw_input("Delete which score?: ")) if score in scores: scores.remove(score) else: print score, "isn't in the high scores list." # list high-score table for score in scores: print score
1. | List Delete: delete one item and delete an entire section | ||
2. | Deleting List Elements | ||
3. | List: delete an element | ||
4. | List: delete a slice :2 |