Pop.py

>>> L = ['spam', 'eggs', 'ham'] >>> L.index('eggs') #Index of an object (search/find) 1 >>> L.insert(1, 'toast') # Insert at position >>> L ['spam', 'toast', 'eggs', 'ham'] >>> L.remove('eggs') # Delete by value >>> L ['spam', 'toast', 'ham'] >>> L.pop(1) # Delete by position 'toast' >>> L ['spam', 'ham'] >>> L.count('spam') # Number of occurrences 1
The pop method

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.