I'm working on assignment, it's about numerical method regarding to trapezoidal rule

```
def trapezoidalRule(F,a,b,n):
  h = float(b-a)/n
  f_sum = 0
  for i in range(1, n, 1):
    x = a + i * h
    f_sum = f_sum + f(x)
  return h * (0.5 * f(a) + f_sum + 0.5 * f(b))

def f(x):
  return x**3

a = 2
b = 10
n = 512

print('%.16f' %trapezoidalRule(f, a, b, n))

```

And the output is

```
2496.0058593750000000

```

My question is, **how do i get a precission like that.. without using `print('%.16f' %trapezoidalRule(f, a, b, n))`**. I want to append the result to the list, with exact value like that.. 
I already tried to google it, but i found nothing related to this problem, can somebody tell me the solution if i want to it ?