Question 2 • SC-Fundamentals of Computing - Content Recovery - Design & Development
A list with count items has valid indices from 0 through count - 1. random.randint(a, b) can return either endpoint, so random.randint(0, count - 1) chooses a valid index. The choice random.randint(0, count) could return count, which is outside the list.
AI-written and checked against the verified answer.