fork download
  1. #This is my PYTHON program
  2. import math;
  3. x=y=float();
  4. A=B=dx=float();
  5. print("Please enter value for start A\n");
  6. A=float(input());
  7. print("Please enter value for finish B\n");
  8. B=float(input());
  9. print("Please enter value for step dx\n");
  10. dx=float(input());
  11. x=A;
  12. while True:
  13. y=2**((1-math.fabs(x))/(1+math.fabs(x)));
  14. print(f"x={x:10.3f} y={y:10.3f}");
  15. x=x+dx;
  16. if x>B:
  17. break;
Success #stdin #stdout 0.08s 14192KB
stdin
-5
5
0.5
stdout
Please enter value for start A

Please enter value for finish B

Please enter value for step dx

x=    -5.000  y=     0.630
x=    -4.500  y=     0.643
x=    -4.000  y=     0.660
x=    -3.500  y=     0.680
x=    -3.000  y=     0.707
x=    -2.500  y=     0.743
x=    -2.000  y=     0.794
x=    -1.500  y=     0.871
x=    -1.000  y=     1.000
x=    -0.500  y=     1.260
x=     0.000  y=     2.000
x=     0.500  y=     1.260
x=     1.000  y=     1.000
x=     1.500  y=     0.871
x=     2.000  y=     0.794
x=     2.500  y=     0.743
x=     3.000  y=     0.707
x=     3.500  y=     0.680
x=     4.000  y=     0.660
x=     4.500  y=     0.643
x=     5.000  y=     0.630