Solution (source code)

= Solution

Put $P=|p|$ and $\zeta=e^{2\pi i/p}$. The <lens space> is the quotient
$$
\boxed{L(p,q)=S^3/\langle g\rangle,\qquad
S^3=\{(z_1,z_2)\in\mathbb C^2:|z_1|^2+|z_2|^2=1\},\quad
 g(z_1,z_2)=(\zeta z_1,\zeta^qz_2).}
$$
The <cyclic group> has order $P$. Its action is free: if $g^j$ fixes a point with $z_1\ne0$, then $p\mid j$; if $z_1=0$, then $z_2\ne0$ and $p\mid qj$, which again implies $p\mid j$ by coprimality. A finite free smooth action gives a closed orientable <three-manifold>, and the quotient projection is a <covering space>.

Since $S^3$ is simply connected, this is the universal covering and its deck group is the <cyclic group> of order $P$. Hence
$$
\boxed{\pi_1L(p,q)\cong\mathbb Z/P\mathbb Z.}
$$
For $P=1$ the quotient is $S^3$ and the group is trivial. With this unoriented quotient convention, replacing $p$ by $-p$ reverses the chosen generator and leaves the quotient unchanged; oriented surgery conventions may record the signs differently.