Skip to content

Navigation Menu

Sign in
Appearance settings

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

Provide feedback

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

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Fix IndexError in 10_create-python-file.md#15

Open
AlintaLu wants to merge 1 commit intogithubtraining:main from
AlintaLu:fix-python-script-index-error
Open

Fix IndexError in 10_create-python-file.md #15
AlintaLu wants to merge 1 commit intogithubtraining:main from
AlintaLu:fix-python-script-index-error

Conversation

@AlintaLu
Copy link

@AlintaLu AlintaLu commented Jan 5, 2021

When selecting a random fact from fact_list, suggest change the upper bound from len(fact_list)+1 to len(fact_list)-1, since random.randint(0, len(fact_list)+1) returns a random number between 0 and len(fact_list)+1 (both included), which might throw a list index out of range error.

@github-learning-lab github-learning-lab bot had a problem deploying to production January 5, 2021 20:52 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /