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("A=",A);
  8. print ("Please enter value for finish B\n");
  9. B=float(input());
  10. print("B=",B);
  11. print("Please enter value for step dx\n");
  12. dx=float(input());
  13. print("dx=",dx);
  14. x=A;
  15. while (x<=B):
  16. y=2**((1-math.fabs(x))/(1+math.fabs(x)));
  17. print(f"x={x:10.3f} y={y:10.3f}");
  18. x=x+dx;
Success #stdin #stdout 0.11s 14232KB
stdin
-5
5
0.5
stdout
Please enter value for start A

A= -5.0
Please enter value for finish B

B= 5.0
Please enter value for step dx

dx= 0.5
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