mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-18 18:14:34 +08:00
psf/black code formatting (#1421)
* added sol3.py for problem_20 * added sol4.py for problem_06 * ran `black .` on `\Python`
This commit is contained in:

committed by
Christian Clauss

parent
11e2207182
commit
7592cba417
@ -22,13 +22,13 @@ def explicit_euler(ode_func, y0, x0, stepsize, x_end):
|
||||
>>> y[-1]
|
||||
144.77277243257308
|
||||
"""
|
||||
N = int(np.ceil((x_end - x0)/stepsize))
|
||||
N = int(np.ceil((x_end - x0) / stepsize))
|
||||
y = np.zeros((N + 1,))
|
||||
y[0] = y0
|
||||
x = x0
|
||||
|
||||
for k in range(N):
|
||||
y[k + 1] = y[k] + stepsize*ode_func(x, y[k])
|
||||
y[k + 1] = y[k] + stepsize * ode_func(x, y[k])
|
||||
x += stepsize
|
||||
|
||||
return y
|
||||
@ -38,4 +38,3 @@ if __name__ == "__main__":
|
||||
import doctest
|
||||
|
||||
doctest.testmod()
|
||||
|
||||
|
Reference in New Issue
Block a user