I discover this Answer employing a dictionary relatively tasteful, highly effective and pythonic. Early optimisations are evil in any case so let's have a dict and see afterwards it it's a bottleneck.See the descriptions of the Specific approaches that determine descriptors next to the 1st paragraph of this reply For additional descriptive variable