Answer the question
In order to leave comments, you need to log in
How to do it in one line?
I am a romantic and I want to write this in one line:
s = [input() for i in range(4)]
for i in range(4):
for j in range(i+1, 4):
print(s[i], s[j], sum(a!=b for (a, b) in [*zip(s[i], s[j])]))
print((lambda s:
([(
(s[i], s[j], sum(a != b for (a, b) in [*zip(s[i], s[j])]))
for i in range(4) for j in range(i+1, 4)
)])
)
(input() for i in range(4)))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question