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:
Ankur Chattopadhyay
2019-10-22 22:43:48 +05:30
committed by Christian Clauss
parent 11e2207182
commit 7592cba417
28 changed files with 413 additions and 252 deletions

View File

@ -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()