Here are some exercises for you to try on your own. Solutions are available at http://pragprog.com/titles/gwpy3/practical-programming.
Write a function called find_dups that takes a list of integers as its input argument and returns a set of those integers occurring two or more times in the list.
Write the bodies of the new versions of functions read_molecule and read_all_molecules from Creating New Type Annotations.
Python’s set objects have a method called pop that removes and returns an arbitrary element from the set. If the set gerbils contains five cuddly little animals, for example, calling gerbils.pop() five times will return those animals one by one, leaving the set empty at the end. Use this to write a function called ...