Lucky Dip

You might have seen the National Lottery numbers drawn on a Saturday night - you might have even helped someone pick their numbers. When the National Lottery first started, it used to "roll over" all the time, because although there are 14 million combinations of numbers, and 30 million tickets might be sold, not all of the combinations were being used. This is because people used things like house numbers, birthdays and other dates, which are more likely to be at the lower end of the number range. So the Lucky Dip was introduced - you can ask the lottery machine (or the web-site, if you're playing on-line) to pick the numbers for you. Random numbers are more evenly distributed, which makes it not only more likely that the jackpot will be won, but also more likely that the winner will win on their own and not have to share the prize.

How Does It Work?

If you aren't familiar with the standard National Lottery Lotto game, you need to choose six numbers from 1 to 49. The numbers are drawn by placing numbered balls into a machine and picking six out - each number can therefore only be chosen once.

The balls are coloured as follows:

Your Task

Your task is to write a program that will choose the lottery numbers for a user - the Lucky Dip. Your program should:

  1. choose six random numbers from 1 to 49
  2. display the numbers and what colour the ball should be, e.g. "1 - White" (it is possible to change the text colour in Python, but it requires additional libraries)
  3. sort the numbers into order
  4. check that there are no duplicates - i.e. that each number appears only once

Start with the first point and do as many of the points as you are comfortable with. Don't forget to make your program easy to use and to give clear instructions to the user about what they need to do.