It turns out that once we build a way to calculate the outcome of a single game, simulating multiple games doesn't require much more work. In fact, you just need a way to determine a schedule of games in advance, put the code we used in the last section into a loop, and then create a way to keep track of how many games each team has won or lost. This is exactly what we will do in this section.
If you completed the previous recipe, you should already have approximately a third of the code you will need for this section.
Perform the following steps to simulate multiple games using the same logic as in the previous recipe:
As mentioned previously, the first thing we will need to do is create a schedule of games to know which teams are going to play each other. There are a few ways to do this, one of which is importing the actual season schedule. For illustrative purposes, we will generate our own schedule...