Dear Joshi
Its not applicable to all cases. Generally the mass number or atomic weight depends on the number of proton + number of neutron.
Here in potassium, the proton number is 19 and neutron number is 20.
So its mass number or atomic weight = 19 + 20 = 39