Message253537
Invalid example at this page: https://docs.python.org/3.6/library/random.html
'.items()' is missed in the line below:
>>> population = [val for val, cnt in weighted_choices for i in range(cnt)]
The correct variant:
>>> population = [val for val, cnt in weighted_choices.items() for i in range(cnt)] |
|
Date |
User |
Action |
Args |
2015-10-27 13:52:10 | Anton Tagunov | set | recipients:
+ Anton Tagunov, docs@python |
2015-10-27 13:52:10 | Anton Tagunov | set | messageid: <1445953930.63.0.811107354907.issue25490@psf.upfronthosting.co.za> |
2015-10-27 13:52:10 | Anton Tagunov | link | issue25490 messages |
2015-10-27 13:52:10 | Anton Tagunov | create | |
|