Problems with Python syntax
As we can see from https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/Maya-Scripting/files/GUID-C0F27A50-3DD6-454C-A4D1-9E3C44B3C990-htm.html :


  Maya installs Python with your Maya installation. Maya uses Python
  version 2.7.11 on all supported platforms. 


Maya uses an old legacy version of Python while Blender uses Python version 3.5.3. There are syntax differences between these versions and brackets is one of them. I am not sure about indentation in 2.7.11, but in the version that comes with Blender it is 4 spaces. 

The sequence in which the selected objects are stored is not something that can be intuitive in my opinion and there is no logical reason one way is better than the other, however if you wish to reverse the order you can do so with Python very easily:

sel = bpy.context.selected_objects[::-1]