python convert list to dictionary with index