teach-ict.com logo

THE education site for computer science and ICT

Random numbers

2. Python

Python is a very popular, free, programming language. It comes with a number of useful modules for various tasks. And one of those modules offers the creation of random numbers.

Therefore we shall use Python to demonstrate how random numbers are handled in a real programming sitation.

The code we demonstrate over the following pages is written using Python 3. If you want to follow along, please ensure that you have it installed on your computer. It can be found at: https://www.python.org/

 

python code

 

We have also chosen to use a free Python IDE called 'Thonny'.

You can download the installation at https://thonny.org. The installation comes with Python 3 built in, so no need to download from python.org if this is used.

 

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: What is Python language