Skip to content

Instantly share code, notes, and snippets.

@ricardovsilva
Created February 1, 2016 15:06
Show Gist options
  • Select an option

  • Save ricardovsilva/e7a189b8b33a864e6ad8 to your computer and use it in GitHub Desktop.

Select an option

Save ricardovsilva/e7a189b8b33a864e6ad8 to your computer and use it in GitHub Desktop.
Example of pop command in python. It illustrates how get first element of a list.
students_marks = ["Marcela", "87", "45", "22", "100"]
student_name = students_marks.pop(0) #Zero is to get the FIRST element of the list
#pop command retrieve the value and REMOVE it from list
print student_name
# Marcela
print students_marks
# ["87", "45", "22", "100"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment