Year 11

Year 11

Randomisation

Lesson details

Key learning points

1. In this lesson, we will be introduced to the concept of random numbers using Python documentation. We will determine what the random module is capable of, and how random numbers can be generated in Python. In computer science, random numbers are something that you are likely to use regularly. They are also used in areas such as cryptography, while pseudorandom numbers are used in video games, modelling, and simulations.

Licence

This content is made available by Oak National Academy Limited and its partners and licensed under Oak’s terms & conditions (Collection 1), except where otherwise stated.

Video

Share with pupils

4 Questions

Q1.
True or False: Pseudorandom number generation uses mathematical algorithms which are computer-generated and therefore highly predictable.
False
Q2.
If you want to comment on your code over multiple lines, what syntax should you use?
Correct answer: ''' ''' 3 x quotation marks at the start and the end
" " A single speech mark at the start and the end
# A hashtag at the start and another # at the end
Q3.
When using the function randrange(1,5,2), what is the third value in the brackets used for?
The maximum value
The minmum value