"Paul McGuire" <[EMAIL PROTECTED]> writes:
> >>> def offByNoMoreThanOneCharacter(a,b):
> ... return len(a)==len(b) and sum(map(lambda (x,y): x==y, zip(a,b))) >=
> len(a)-1
Yikes! How about (untested):
def offByNoMoreThanOneCharacter(a,b):
return len(a)==len(b) and \
len([i for i i
"manstey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Is there a clever way to see if two strings of the same length vary by
> only one character, and what the character is in both strings.
>
> E.g. str1=yaqtil str2=yaqtel
>
> they differ at str1[4] and the difference is