Mass percent = (mass of the desired compound / mass of the mixture) x 100%
Let's take 1 L of solution.
Density of the solution = 1.27 g/ml
Hence mass of 1 ml = 1.27 g
Then mass of 1 L (1000 ml) = 1.27 g/ml x 1000 ml = 1270 g
Molarity of KI = 2.89 mol/L
Hence moles in 1 L = 2.89 mol
Than mass of KI in 1 L = moles x molar mass
= 2.89 mol x 166.00 g/mol
= 479.74 g
Hence mass percent = (mass of KI / mass of the solution) x 100%
= (479.74 g / 1270 g) x 100%
= 37.77%
Hence, the mass percent of KI is 37.77%.