Skip to content

Conversation

@c-w
Copy link
Contributor

@c-w c-w commented Mar 25, 2017

The random.choice method performs sampling with replacement. This means that the get_ten_random method could return the same question more than once which is not a great user experience.

Using random.sample (part of the standard library since 2.3 so we can for sure assume that it's available), we perform sampling without replacement so that we prevent any possibility of duplicate questions.

c-w added 5 commits March 25, 2017 16:13
The `random.choice` method performs sampling with replacement. This
means that the `get_ten_random` method could return the same question
more than once which is not a great user experience.
Using `random.sample` (part of the standard library since 2.3 so we can
for sure assume that it's available), we perform sampling without
replacement so that we prevent any possibility of duplicate questions.
@alexgreene alexgreene merged commit 71c713b into alexgreene:master May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants