Skip to main content
Commonmark migration
Source Link

Post an answer, even if you directly copy from that first easy-to-find search result, for example:

"How do I delete the last index from a list, in Python?":

From http://docs.python.org/tutorial/datastructures.html#more-on-lists:

 

list.pop([i])

Remove the item at the given position in the list, and return it. If no index is specified, a.pop() removes and returns the last item in the list. (The square brackets around the i in the method signature denote that the parameter is optional, not that you should type square brackets at that position. You will see this notation frequently in the Python Library Reference.)

 

Or you can also use the del statement, by doing..

del mylist[-1]

Which would take less than a minute to write and post, and would be a useful answer.

If a question is easy to answer by a simple search, it's easy for you to answer (even if you copy/paste the important bit, and link to the page).. but more importantly, those answers "on Google" have to originate somewhere.. StackOverflow will be ranked highly on Google - if you post "Just Google it!"-like answers, those will end up being the "answers" people find!

Post an answer, even if you directly copy from that first easy-to-find search result, for example:

"How do I delete the last index from a list, in Python?":

From http://docs.python.org/tutorial/datastructures.html#more-on-lists:

 

list.pop([i])

Remove the item at the given position in the list, and return it. If no index is specified, a.pop() removes and returns the last item in the list. (The square brackets around the i in the method signature denote that the parameter is optional, not that you should type square brackets at that position. You will see this notation frequently in the Python Library Reference.)

 

Or you can also use the del statement, by doing..

del mylist[-1]

Which would take less than a minute to write and post, and would be a useful answer.

If a question is easy to answer by a simple search, it's easy for you to answer (even if you copy/paste the important bit, and link to the page).. but more importantly, those answers "on Google" have to originate somewhere.. StackOverflow will be ranked highly on Google - if you post "Just Google it!"-like answers, those will end up being the "answers" people find!

Post an answer, even if you directly copy from that first easy-to-find search result, for example:

"How do I delete the last index from a list, in Python?":

From http://docs.python.org/tutorial/datastructures.html#more-on-lists:

list.pop([i])

Remove the item at the given position in the list, and return it. If no index is specified, a.pop() removes and returns the last item in the list. (The square brackets around the i in the method signature denote that the parameter is optional, not that you should type square brackets at that position. You will see this notation frequently in the Python Library Reference.)

Or you can also use the del statement, by doing..

del mylist[-1]

Which would take less than a minute to write and post, and would be a useful answer.

If a question is easy to answer by a simple search, it's easy for you to answer (even if you copy/paste the important bit, and link to the page).. but more importantly, those answers "on Google" have to originate somewhere.. StackOverflow will be ranked highly on Google - if you post "Just Google it!"-like answers, those will end up being the "answers" people find!

Post Made Community Wiki by LauraStaffMod
Post Migrated Here from stackoverflow.com (revisions)
Source Link
dbr
  • 23.2k
  • 10
  • 67
  • 86

Post an answer, even if you directly copy from that first easy-to-find search result, for example:

"How do I delete the last index from a list, in Python?":

From http://docs.python.org/tutorial/datastructures.html#more-on-lists:

list.pop([i])

Remove the item at the given position in the list, and return it. If no index is specified, a.pop() removes and returns the last item in the list. (The square brackets around the i in the method signature denote that the parameter is optional, not that you should type square brackets at that position. You will see this notation frequently in the Python Library Reference.)

Or you can also use the del statement, by doing..

del mylist[-1]

Which would take less than a minute to write and post, and would be a useful answer.

If a question is easy to answer by a simple search, it's easy for you to answer (even if you copy/paste the important bit, and link to the page).. but more importantly, those answers "on Google" have to originate somewhere.. StackOverflow will be ranked highly on Google - if you post "Just Google it!"-like answers, those will end up being the "answers" people find!