The code for the generate_subsets() function is derived heavily from Allen Downey’s Stack Overflow answer.
generate_subsets()
Contents: