Skip to content

Commit

Permalink
Merge pull request #310 from MARGYYY1231/sheet
Browse files Browse the repository at this point in the history
Added Python List commands
  • Loading branch information
Jahenr authored Mar 24, 2024
2 parents 494e8df + 1e11772 commit 69f6c42
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Python_CheatSheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,23 @@
#This method adds an element at the end of the list.
list.append(element)

#This method removes the first item from list whose value is equal to the element.
list.remove(element)

#This method inserts an item at a given index/position
list.insert(index, x)

#Removes an item at the given postion in the list and returns it
list.pop([i])

#Clears the entire list
list.clear()

#Count the number of times x appears in the list
list.count(x)

#Reverses the elements of the list
list.reverse()

#Returns a shallow copy of a list
list.copy()

0 comments on commit 69f6c42

Please sign in to comment.