Potassium has the electron configuration 1s^2 2s^2 2p^6 3s^2 3p^6 4s^1, but when it becomes an ion (by being either positively or negatively charged) the potassium loses an electron (as it is easier for potassium to transfer 1 electron vs attracting 7).
Therefore a potassium ion has one less electron than a potassium and would look like 1s^2 2s^2 2p^6 3s^2 3p^6, which is identical to argon.