moving files
This commit is contained in:
14
q1/renforcement/entrainement_0712/stringdiff.py
Normal file
14
q1/renforcement/entrainement_0712/stringdiff.py
Normal file
@ -0,0 +1,14 @@
|
||||
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)
|
Reference in New Issue
Block a user