Open ScottBaba8 opened 10 months ago
def letters(text): value_map = {} while text != "": num = (text.count(text[0].lower())+(text.count(text[0].upper()))) removeU = text[0].upper() removeL = text[0].lower() value_map[text[0]] = num text = text.replace(removeU, "") text = text.replace(removeL, "") print(value_map) this is a quick function to allow me to find the amount of each letter in a title
I need an efficient way of gathering data for my tables. manually counting each letter will be inefficient.