cours_progra/bac1/q1/renforcement/entrainement_0712/stringdiff.py
Debucquoy 4fd7542f03
.
2023-09-20 15:18:20 +02:00

15 lines
395 B
Python

def diff(in1: str, in2: str) -> list:
ret = list()
for k, v in enumerate(in1):
if in2[k] != v :
ret.append((k, v, in2[k]))
return ret
if __name__ == "__main__":
in1, in2 = input("entrez la phrase 1:") , input("entrez la phrase 2")
diff_ins = diff(in1, in2)
if len(diff_ins) == 0:
print("Phrases identiques")
else:
print(diff_ins)