Skip to content

Commit

Permalink
Update python.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nkoroste authored Dec 13, 2024
1 parent f928759 commit ae2ff51
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ lst[:-1] # All but the last element
lst[i] = value # Set an element
lst.append(value) # Add to the end
lst.insert(i, value) # Insert at position i
lst.extend(other) # Add multiple elements
lst.pop(i=-1) # Remove and return element (default: last)
lst.remove(value) # Remove first occurrence
del lst[i:j] # Delete slice
```suggestion
lst.extend([1,2,3]) # Extends list with another list
lst.pop() # Remove and return element. Can also accept an index.
lst.remove(value) # Remove first occurrence of value
del lst[i:j] # Delete slice between i and j-1
list1 + list2 # combine two list

# Useful methods
Expand Down

0 comments on commit ae2ff51

Please sign in to comment.