I just started learning algebraic topology recently.I'm not sure if I got the idea correctly.Hope someone would check it.
My solution:Since $X$ is contractible and path-connected,then $X$ is simply connected.Thus $\pi_{1}(X)$ is trivial.
Does this work?
The fact that $X$ is simply connected is what you should prove. Note that $X$ is always path connected if it is contractible: suppose that $id_X \simeq c_{x}$ for some $x \in X$ via a homotopy
$$ H : X \times I \to X, $$
which satisfies $H_0 = id$ and $H_1 = c_{x}$. For any $y \in X$, the map $H(y,-)$ is a path from $y$ to $x$.
To show that $\pi_1(X)$ you can see that moreover we have $X \simeq *$,