Solution (source code)

= Solution
{c}

Let $n=(0,0,1)$ and use the <open cover>
$$
U=Y\setminus\{n\},\qquad V=\{(x,y,z)\in S^2:z>1/2\}.
$$
The cap $V$ is open in $Y$: it equals $Y\cap\{z>1/2\}$ because the attached chord has $z=0$. The cap is <homeomorphic> to an <open disk>, and $U\cap V=V\setminus\{n\}$ is a punctured <open disk>, hence <homotopy equivalent> to a <circle>. Both sets and their <intersection> are <path-connected>. Choose the <base point> $b$ in that <intersection>.

We first calculate $\pi_1(U,b)$. A <stereographic projection> identifies $S^2\setminus\{n\}$ with $\mathbb R^2$ and sends the two chord endpoints to $(-1,0),(1,0)$. Thus $U$ becomes the <Euclidean plane> with an extra <closed interval> attached at those two points. This description is a <homeomorphism>: gluing the two closed pieces along their endpoints gives exactly the original <subspace topology>.

The <Euclidean plane> has a <deformation retraction> onto $L=[-1,1]\times\{0\}$ while fixing its endpoints. An explicit <homotopy> is
$$
D((u,v),t)=\big((1-t)u+t\,c(u),(1-t)v\big),\qquad
c(u)=\max(-1,\min(1,u)).
$$
Extend it by the <identity map> on the extra chord. The <pasting lemma for closed subspaces> gives a <deformation retraction> of $U$ onto two distinct <closed intervals> sharing just their endpoints, a <circle>. Consequently $\pi_1(U,b)\cong\mathbb Z$, with the routine <base point> transport if the <retraction> moves $b$.

The inclusion-induced <group homomorphism> $\pi_1(U\cap V,b)\to\pi_1(U,b)$ is trivial: it factors through $S^2\setminus\{n\}\cong\mathbb R^2$, which is <contractible>. Also $\pi_1(V,b)=1$. All hypotheses of the <Seifert-van Kampen theorem> are now checked, and it gives the <fundamental group of a sphere with an attached chord>:
$$
\boxed{\pi_1(Y,b)\cong\mathbb Z*_{\mathbb Z}1\cong\mathbb Z,}
$$
where both maps from the amalgamating <infinite cyclic group> are trivial. A <group generator> follows the chord from one endpoint to the other and returns along any <path> on the <sphere>, with a connecting <path> from the chosen <base point>.