With steplength $h$, the implicit Euler method for this equation would say
$$y_{n+1}-y_n=hy_{n+1}^2.$$
Seeing this as a quadratic equation to solve for $y_{n+1}$, we get
$$y_{n+1}=\frac{1\pm\sqrt{1-4hy_n}}{2h},$$
but you need to pick the correct sign. For concistency, you absolutely need to have $y_{n+1}$ converging to $y_n$ if you let $h\to0$, and that immediately eliminates the plus sign (which would have the right hand side going off to $\pm\infty$), leaving
$$y_{n+1}=\frac{1-\sqrt{1-4hy_n}}{2h}$$
as the only sensible choice.
You may, and probably should, go further and verify that this is in fact consistent. This might involve taking a Taylor expansion of the square root, or perhaps my favourite trick for fractions of this kind: Multiplying numerator and denominator by $1+\sqrt{1-4hy_n}$.
I'll stop here, as you do need to do some if this work on your own.
The error of both explicit and implicit Euler are $O(h)$. So
$$f(x-h) = f(x) - h f'(x) + \frac{h^2}{2} f''(x) - \frac{h^3}{6} f'''(x) + \cdots$$
and
$$f(x+h) = f(x) + h f'(x) + \frac{h^2}{2} f''(x) + \frac{h^3}{6} f'''(x) + \cdots$$
So the backward Euler is
$$f(x) - f(x-h) = h f'(x) - \frac{h^2}{2} f''(x) + \frac{h^3}{6} f'''(x) - \cdots$$
$$f'(x) = \frac{f(x) - f(x-h)}{h} + \frac{h}{2} f''(x) - \frac{h^2}{6} f'''(x) + \cdots$$
the backward Euler is first order accurate
$$f'(x) = \frac{f(x) - f(x-h)}{h} + O(h)$$
And the forward Euler is
$$f(x+h) - f(x) = h f'(x) + \frac{h^2}{2} f''(x) + \frac{h^3}{6} f'''(x) + \cdots$$
the forward Euler is first order accurate
$$f'(x) = \frac{f(x+h) - f(x)}{h} + O(h)$$
We can do a central difference and find
$$f(x+h) - f(x-h) = (h f'(x) + \frac{h^2}{2} f''(x) + \frac{h^3}{6} f'''(x) + \cdots) - (- h f'(x) + \frac{h^2}{2} f''(x) - \frac{h^3}{6} f'''(x) + \cdots)$$
$$f(x+h) - f(x-h) = (h f'(x) + \frac{h^2}{2} f''(x) + \frac{h^3}{6} f'''(x) + \cdots) + (h f'(x) - \frac{h^2}{2} f''(x) + \frac{h^3}{6} f'''(x) - \cdots)$$
$$f(x+h) - f(x-h) = 2 h f'(x) + \frac{h^3}{6} f'''(x) + \cdots$$
$$f'(x) = \frac{f(x+h) - f(x-h)}{2h} - \frac{h^2}{12} f'''(x) + \cdots$$
Therefore, the central difference is second order accurate.
$$f'(x) = \frac{f(x+h) - f(x-h)}{2h} + O(h^2)$$
Best Answer
This code implements the explicit Euler scheme.
In order to be implicit, there would be an instruction like
in the inner loop, where
solve(equation, variable)
is a suitable function to solve an equation (see here).