For this problem we will modify the MC program to make a series of runs with temperatures separated by a value ΔT.
1. Use the Python function definition feature to create a function that does the entire MC simulation. Then put the function call inside a loop that first equilibrates the spins for some number of sweeps and then generates the data you want from a longer number of sweeps. The loop should change the temperature by an amount ΔT for every iteration of equilibration and data-taking.
2. Calculate the average energy,