36.7k views
13 votes
In your guessing game, you randomly chose a word from your word list. Complete the code to randomly choose an index found in the list.

import random
count = len(words)
wordIndex =

A. random.random(0,count)
B. random.random(0,count - 1)
C. random.randint(0,count)
D. random.randint(0,count - 1)

User Tyrina
by
3.7k points

2 Answers

10 votes

Answer: random.randint(0,count - 1)

Explanation: Not necessarily answer D because Edge switches the order of the questions for everyone. Just know its random.randint(0,count - 1)

User Sunil Verma
by
5.0k points
11 votes

Answer:

the answer is D random.randint(0,count -1)

Step-by-step explanation:

I took the assignment

User Shaun Mason
by
4.7k points