def worddistance(source, target):
''' Return the Levenshtein distance between 2 strings '''
if len(source) > len(target):
source, target = target, source
#Now target becomes the larger string, if it is 0, surely len(source) is 0?
if len(target) == 0:
return len(source)
### Continue on to calculate distance.
Isn't it the same as saying if both the parameters are the same, return 0?
I am not exactly sure what this part of the function is trying to achieve