← 返回首页
Use random.choice instead of random.randint by uttamo · Pull Request #9 · realpython/python-scripts · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Use random.choice instead of random.randint#9

Merged
mjhea0 merged 1 commit into
realpython:masterfrom
uttamo:patch-1
Sep 29, 2017
Merged

Use random.choice instead of random.randint#9
mjhea0 merged 1 commit into
realpython:masterfrom
uttamo:patch-1

Conversation

Copy link
Copy Markdown
Contributor

uttamo commented Sep 28, 2017

random.choice is better for selecting random elements from a list than using random.randint to generate random indices to select

random.choice is better for selecting random elements from a list than using random.randint to generate random indices to select
mjhea0 merged commit c2f695f into realpython:master Sep 29, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.