policz, ile znaków w tej samej pozycji jest eqial w obu strunach
sum(1 if c1 == c2 else 0 for c1, c2 in zip(string1, string2))
Rich Rabbit
sum(1 if c1 == c2 else 0 for c1, c2 in zip(string1, string2))
sum(c1 == c2 for c1, c2 in zip(string1, string2))