Iterators and Generators: Difficult Solutions
Write a generator function that goes through a tree and yields all of the values in the tree.
for branch in t.branches():
yield from tree_gen(branch)
Write a generator function that yields the elements in a list in order from greatest to least. You can assume there is at least one element in the list, and that all elements are unique.
>>> lst = [8, 1, 5, 7]
>>> gen = sort_list_gen(lst)
while len(lst) > 0: