fork download
  1. def eval():
  2. y = []
  3. x = -2.
  4. while x <= 2.:
  5. y.append(f(x))
  6. x += .3
  7. return y
  8.  
  9. def f(x):
  10. return (x+1)/(x*x)
  11.  
  12. print(eval())
  13.  
  14.  
Success #stdin #stdout 0.02s 63552KB
stdin
Standard input is empty
stdout
[-0.25, -0.24221453287197234, -0.2040816326530612, -0.08264462809917346, 0.31250000000000044, 2.000000000000002, 20.000000000000036, 109.99999999999969, 8.749999999999995, 3.4693877551020393, 1.9999999999999991, 1.3609467455621298, 1.0156249999999998, 0.8033240997229916]