generate functionTue, 21 Mar 2023

the program finds the number of all repeated characters in the lines and forms a list

def repeated_characters(s): res = [] for i in s: if s.count(i) > 1: if i not in res: res.append(i) return res repeated_characters('AaBbCcDd')

Questions about programming?Chat with your personal AI assistant