Step 4 – how many people
The birthday paradox says we need 23 people in our list to expect to get a match.
But we might want to experiment with different numbers of people later on.
So, let's add that in now.
- Change your program as shown
- Use an input line to get the user to tell you how many people are in the group
We store this in a variable called people
We need to use int to convert this in to a number
Careful with the brackets here - Then change the for loop to be from 0 to people
- Run your program to check it works (Run > Run module) using 23 people to start with
Most of the time you'll enter 23 when asked