Step 8 – calculate the percentage
We can calculate the percentage of times we got a match and add this at the bottom.
- Add the code shown at the bottom of your program
- I've shown you code for 1000 runs of the program
- If you only have it repeating 10 times or 100 times you'll need to change the code to divide by 10 or 100
- Run your program to check it works (Run > Run module)
You should get the percentage of matches, which should be close to 50% if the birthday paradox works