Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Python is relatively consistent with regards to appending/popping/inserting/removing:

a=[] dir(a) 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort'

help(a.remove) remove(...) L.remove(value) -- remove first occurrence of value

help(a.pop) pop(...) L.pop([index]) -> item -- remove and return item at index (default last)

append(...) L.append(object) -- append object to end

insert(...) L.insert(index, object) -- insert object before index



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: