Yeah, that's wrong... What you should have is 5 identical arrays in a list:
[array([-8., -6., -4., -2., 0., 2., 4., 6., 8.]), array([-8., -6., -4., -2., 0., 2., 4., 6., 8.]), array([-8., -6., -4., -2., 0., 2., 4., 6., 8.]), array([-8., -6., -4., -2., 0., 2., 4., 6., 8.]), array([-8., -6., -4., -2., 0., 2., 4., 6., 8.])]
So, somehow readTotalEnergy doesn't like the object IDs in the NetCDF files perhaps... There is a risk the indentation got mangled when you saved the script (as would be indicated by your other error, about "return"). Try to download the script again, not by copy/pasting it, but just clicking the link to it in the tutorial HTML page, and then save it directly. Otherwise attach readTotalEnergy.py as a file to your Forum post so I can check this point.