Define a function named last_position_disagree(...) which receives as parameter two strings str1 and str2 of the same length, consisting only of letters, and returns the last position where the two strings have different letters. Upper case and lower case versions of the same letter are treated as being identical. If there is no such position, the value -1 should be returned. Hint: Consider visiting the strings backwards.
As an example, the following code fragment:
str1 = "hallo"
str2 = "hxlxo"
should produce the output:
- brilliant_movesLv 72 months ago
"Hint: Consider visiting the strings backwards." Do you know how to do this?
def last_position_disagree (str1, str2):
for i in range (len (str1)-1, -1, -1): # index i goes from last letter index to first
Your next line of code should be an if statement. I will let you figure out the rest.