Generation

generate functionThu, 05 Jan 2023

write a simple program to find number of letters repeated in given string 'aa,bbb,cccc,ddddd,' output:a2 b3 c4 d5

def count_char(str): for char in str: if char not in dict: dict[char] = 1 else: dict[char] += 1 print(dict)

Want to kickstart your project?Use the new AI Studio to create your code