Simulate Events (Exercise)
00:00 I start getting the feeling that you’re being well prepared for the challenge that’s up ahead. So let’s do one final review exercise and solve this one, and then move on to the challenge.
00:10
This task is to write a function that’s called roll()
and that uses the randint()
function from the random
module to simulate rolling a fair die by returning a random interval between 1
and 6
.
00:21
So, you should write a function that uses a function from the random
module, and to return a number between 1
and 6
.
00:27 Try it out, and then move on to the next lesson to see my possible solution.
Become a Member to join the conversation.