Jul-29-2019, 10:22 AM
Hello,
I make a simple algoritm to compare two strings, but the loop do not continue to the end. This end is the minimum string lenght from these two data entry.
Here's my code :
Thanks for any help.
I make a simple algoritm to compare two strings, but the loop do not continue to the end. This end is the minimum string lenght from these two data entry.
Here's my code :
j1 = "BB" j2 = "AABBCCDDEEFFGGHHIIJJKKLLMMBBDCCDEEFFGGHHIIJJKKLLMM" t = 0 tab = [] if len(j1) < len(j2): n = len(j1) else: n = len(j2) for i in range(n): while j1[i] == j2[i]: t += 1 tab.append(t) print(tab) print(t)I have this :
[] 0I must have this type of result:
[1, 2] 2For AA in the first string = AA to the second string and the loop stop.
Thanks for any help.
