fork download
  1. #This is my PYTHON program
  2. import math;
  3. x=y=float();
  4. A=B=dx=float();
  5. i=k=int();
  6. print("Please enter value for start A\n");
  7. A=float(input());
  8. print("Please enter value for finish B\n");
  9. B=float(input());
  10. print("Please enter value for step dx\n");
  11. dx=float(input());
  12. k=math.trunc((B-A)/dx)+1;
  13. x=A;
  14. for i in range(0,k,1):
  15. y=2**((1-math.fabs(x))/(1+math.fabs(x)));
  16. print(f"x={x:10.3f} y={y:10.3f}");
  17. x=x+dx;
Success #stdin #stdout 0.13s 14260KB
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