18 lines
354 B
Python
18 lines
354 B
Python
import math
|
|
|
|
try:
|
|
x_zero = float(input("X0 eingeben: "))
|
|
except ValueError as error:
|
|
print(f"Value {error} is not a number")
|
|
quit()
|
|
|
|
n = 1
|
|
T = x_zero - 4 + (math.e ** (x_zero/3)/3)
|
|
print(T)
|
|
while(T!=0):
|
|
f_a2 = 1 + (math.e ** (x_zero/3)/9)
|
|
x_zero -= T/f_a2
|
|
T = x_zero - 4 + (math.e ** (x_zero/3)/3)
|
|
n += 1
|
|
print(T)
|
|
print(n) |