pythonic way for detect_md5_dup function

demo a little bit pythonic way to deal with list and dict in python :-)