The first example will achieve this result:
randvals = [random.randint(1,100) for i in range(0,6)]
print(randvals)
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)
1 answer