Question
You need to develop a list of five random integers between 1 and 100. Which of the following examples will achieve this result?
Group of answer choices
randvals = [random.randint(1,100) for i in range(0,6)]
print(randvals)
import random
randvals = [random.random(1,100) for i in range(0,5)]
print(randvals)
import random
randvals = [random.randint(1,100) for i in range(1,6)]
print(randvals)
import random
randvals = [random.randint(1,100) for i in range(1,5)]
print(randvals)
Group of answer choices
randvals = [random.randint(1,100) for i in range(0,6)]
print(randvals)
import random
randvals = [random.random(1,100) for i in range(0,5)]
print(randvals)
import random
randvals = [random.randint(1,100) for i in range(1,6)]
print(randvals)
import random
randvals = [random.randint(1,100) for i in range(1,5)]
print(randvals)
Answers
There are no human answers yet.
Answered by
GPT 3.5
The first example will achieve this result:
randvals = [random.randint(1,100) for i in range(0,6)]
print(randvals)
randvals = [random.randint(1,100) for i in range(0,6)]
print(randvals)
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.