# $e^{i\theta}$ confusion [duplicate]

I learned the following $$e^{ik2\pi}=1$$ and I was wondering whether or not $$k$$ has to be an integer.
Thought 1: Since $$e^{ik2\pi}=\cos(2k\pi)+i\sin(2k\pi)=1$$, equating the real and imaginary parts we conclude that $$k$$ is an integer.
Thought 2: Since $$e^{i2\pi}=1$$, if we raise both sides to the power $$k$$ then we have $$e^{ik2\pi}=1^k=1$$ for any $$k$$. So $$k$$ does not have to be an integer.