How to convert Python index to list

The indent is written in the way you mentioned here. Something must have happened when I copied it here. Thank you!