LeetCode Flashcards
capitalize only the first letter of the string
capitalize()
Operator checks if the item is in the container
in
removes the key-value pair from dictionary and returns the key-value pair
popitem()
retrieve values of the dictionary
values()
retrieve keys of the dictionary
keys()
returns the stored key-value pairs in a dictionary
items()
returns a new set with items present in one set but not in another
difference()
returns a new set with only common items
intersection()
returns a new set with items from both sets
union()
removes an item from the set
remove()
inserts a new item to a set
add()
counts the amount of a certain item in a list
count()
deletes a specific item from a list
remove()
adds new item to a list
append()
Dictionary
a collection of key-value pairs where keys are unique and immutable; key has a unique correspondence to its value, but not the other way around