New submission from Anton Tagunov:

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)]

----------
assignee: docs@python
components: Documentation
messages: 253537
nosy: Anton Tagunov, docs@python
priority: normal
severity: normal
status: open
title: small mistake in example for random.choice()
versions: Python 3.5, Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25490>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to