def renumber_settings(self): for idx, image in enumerate(self.images): image.image_name.text = "Select the %s image" % (ordinal(idx + 1)) image.factor.text = "Multiply the %s image by" % ordinal(idx + 1)