How can your quiz pick a surprise question without choosing one that doesn't exist?
You're making a quiz for your school, and you want it to pick a question at random. The program can draw a number to choose a question. Which numbers can you let it draw without asking for a question that doesn't exist?
Look at the index column, then the question stored beside each index. There are four questions, but the indices start at zero and end at three. If you look up index two, you get the third question: pence in a pound?
Watch the dots appear: zero, one, two and three. Each dot marks an index the quiz could draw. One draw gives you just one of those integers. Zero is the lower bound and three is the upper bound. Both are included.
A random integer generator has a lower bound of two and an upper bound of five. Both bounds are included. Which list shows every possible result? Pick an answer.
In Python, random dot rand int with zero and three includes both bounds, so you can get zero, one, two or three. Now look at RANDOM INT with zero and three in pseudocode. Its stated rule includes both bounds too, so you get the same four possible results.
You have five questions. Because indexing starts at zero, subtract one from five to get four. The valid indices are zero, one, two, three and four. Import random, then call random dot rand int with zero and four. Save the result in i and use it to look up the question.
You've imported random, and your quiz has six questions in a zero-based array. Which Python call can reach every question without ever giving an invalid index? Pick the correct call.
With five questions, if you pass zero and five, the call can return five. Looking up index five then raises an error. If you pass zero and four instead, the largest result is four, so every result is a valid index.
The code imports random, draws an integer with bounds zero and seven, then prints it. If asked to describe the possible values output, write any integer from zero to seven inclusive. Both bounds can occur, and the bounds alone don't tell you which value comes next.