Created
February 2, 2016 12:34
-
-
Save ricardovsilva/49ab79578c24a9f8a549 to your computer and use it in GitHub Desktop.
Example of list usage in python
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
n = int(raw_input()) | |
my_new_list = [] | |
while n >= 0: | |
my_new_list.insert(0, 5) | |
my_new_list.insert(1, 10) | |
my_new_list.insert(0, 6) | |
print my_new_list | |
my_new_list.remove(6) | |
my_new_list.append(9) | |
my_new_list.append(1) | |
my_new_list.sort() | |
print my_new_list | |
my_new_list.pop() | |
my_new_list.reverse() | |
print my_new_list | |
n = n - 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment