Feb-12-2018, 04:29 PM
What am I doing wrong here? From what I can tell, my for loop (for x in s1) is not actually looping through the characters. But I don't know how to fix it.
# Type your code here def find_mismatch(s1,s2): count = 0 s1 = s1.lower() s2 = s2.lower() s1 = list(s1) s2 = list(s2) #print(s1, s2) if len(s1) != len(s2): return 2 elif s1 == s2: return 0 else: for x in s1: for y in s2: if y != x: count += 1 #return count if count < 2: return 1 else: return 2
Output:Your function return is NOT CORRECT.
For example when your function is called as shown below:
find_mismatch('Hello There', 'helloothere')
Your function returns:
2
The correct return value is:
1