Sequence Analysis Using Python Dictionaries And Sets