Generation

generate functionTue, 25 Apr 2023

Leer un numero entero positivo, eliminar los dos dígitos que más veces se repiten e imprimir el resto

def most_repeated(a): b = list(str(a)) #print(type(b)) c = [] for i in b: c.append(b.count(i)) #print(c) d = [] for i in b: if b.count(i) == max(c): d.append(i) #print(d) for i in sorted(d) [:2]: a = str(a).replace(i, "") print(a) most_repeated(233799) most_repeated(3332215) most_repeated(3334455) most_repeated(33335577) most_repeated(33335578) most_repeated(33345678) most_repeated(3333556778)

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