In general, electron affinity increases in a period from left to right. This is due to decrease in size and increase in nuclear charge as the atomic number increases in a period. Potassium is a metallic element which is electron donor. O−and F− ions gain stability by taking one electron. Only O (oxygen atoms) has tendency to gain electron to attain stability.