0.3075644665076249
3
We need to import
the module random
What do the functions .random()
and .randint()
return?
pick_winner
What happens when you run pick_winner
multiple times?
To get always the same result (for autograding purposes, for example) we can set a seed.
Write a function that takes as argument a list of integers. Iterate over each list element (with a while
loop), replacing each integer with a random number between zero and the original integer.
Test case:
Submit your random_list
to gradescope.
Name your file random_list.py
and remember to set the seed to 123
inside your function.