Skip to content

Instantly share code, notes, and snippets.

@ricardovsilva
Created February 2, 2016 12:34
Show Gist options
  • Save ricardovsilva/49ab79578c24a9f8a549 to your computer and use it in GitHub Desktop.
Save ricardovsilva/49ab79578c24a9f8a549 to your computer and use it in GitHub Desktop.
Example of list usage in python
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