You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
max(counter.keys(), key=counter.get) # Find the highest value out of keys
Deleting mappings
deldict[some_item]
[Other Data Structures]
Set
set.add(4)
set.union(set2)
"String"
Replace / Find / Count
s=s.replace("h","w",3) # Creates a copy of string and replaces first 3 "h"s to "w"s.find("ll",5) # Returns the index of where "ll" is in string after index 5s.lower().count("e") # Creates a copy as lowercases and then counts number of "e"s
Operations
s.capitalize() # First letter is capitalizeds.isalnum() # Checks alphanumeric characters.isalpha() # Checks alphabet characters.isdecimal() # Checks decimal characters.isnumeric() # Checks numeric