Created
February 1, 2016 15:06
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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