Extension tasks
There are some cool things we can do to this program now.
Extension 1: 10000 runs?
You could try running your program 10,000 times to make it an even fairer test.
This might take a few minutes to run. Python's good, but it's not that quick.
Extension 2: use a function
The IF lines that compare the length of the array with the length of the set is a bit of a cheats way to check for matches. It's a bit like a magic bullet.
There's a way to do this by writing your own code and putting that code in a function.
THEORY: a function is a mini program that runs within a program. They're really important at GCSE, so if you're thinking of computer science at GCSE, give this a go.
This makes your program longer, but it also teaches you how to set up a basic function.
Extension 3: catch errors
Run your program and enter something other than a number when it asks for how many people.
The program crashes. This is not a good thing.
There's way to fix this, but it's a little tricky.
I have a page that will show you how it works – click here to go there. It's a cool method to know about, so worth trying out.
Extension 4: leap years
I ignore leap years entirely.
But that's not fair on people born on 29 February. They get fewer real birthdays anyway. How could we write the program to deal with leap year babies?
This is for you to solve.