Skip to content
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
wants to merge 1 commit into
base: main
Choose a base branch
from

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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant