The Python Oracle

A weighted version of random.choice

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 2

--

Chapters
00:00 Question
01:08 Accepted answer (Score 409)
01:39 Answer 2 (Score 366)
03:02 Answer 3 (Score 143)
03:15 Answer 4 (Score 83)
04:08 Thank you

--

Full question
https://stackoverflow.com/questions/3679...

Accepted answer links:
[choice]: https://numpy.org/doc/stable/reference/r...

Answer 2 links:
[choices]: https://docs.python.org/dev/library/rand...
[random]: https://docs.python.org/dev/library/rand...
[docs]: https://docs.python.org/dev/library/rand...
[@ronan-paixão's brilliant answer]: https://stackoverflow.com/a/26196078/312...
[numpy.choice]: https://docs.scipy.org/doc/numpy/referen...

Answer 4 links:
http://docs.python.org/dev/library/bisec...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #optimization

#avk47