← Questions
Robust Python generator, then a weighted one
0
I was asked this
No reports yet. Sign in to say where you were asked it.
- 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 official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
