Skip to content

Instantly share code, notes, and snippets.

@vihar
Created July 19, 2017 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vihar/450348c724f4965e3ce4624799707e42 to your computer and use it in GitHub Desktop.
Save vihar/450348c724f4965e3ce4624799707e42 to your computer and use it in GitHub Desktop.
stationery_list = ["Pen", "Pencil", "Notepad"]
stationery_list.append("Eraser")
# Adds new item at the end of the list
print(stationery_list)
stationery_list.insert(2, "Files")
"""
Insert method inserts a single element into a list.It takes two arguments one is 
the numerical index at which the data is to be inserted and the other is value.
"""
print(stationery_list)
stationery_list.index("Pen")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment