mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
psf/black code formatting (#1277)
This commit is contained in:

committed by
Christian Clauss

parent
07f04a2e55
commit
9eac17a408
@ -8,17 +8,17 @@ def newton(function, function1, startingInt):
|
||||
x_n = startingInt
|
||||
while True:
|
||||
x_n1 = x_n - function(x_n) / function1(x_n)
|
||||
if abs(x_n - x_n1) < 10**-5:
|
||||
if abs(x_n - x_n1) < 10 ** -5:
|
||||
return x_n1
|
||||
x_n = x_n1
|
||||
|
||||
|
||||
def f(x):
|
||||
return (x**3) - (2 * x) - 5
|
||||
return (x ** 3) - (2 * x) - 5
|
||||
|
||||
|
||||
def f1(x):
|
||||
return 3 * (x**2) - 2
|
||||
return 3 * (x ** 2) - 2
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user