Robust Python generator, then a weighted one
- Write a Python generator that yields the numbers of an input list, with unit tests. Handle edge cases such as
Nonevalues and an empty list. - Change it to yield numbers from the list at random according to a given probability for each, and test that the distribution is right.
No answer yet. Write the first one; the best answer gets endorsed.
