https://www.programiz.com/online-compiler/4TjIcERXwWKKI



import numpy as np 

import math

n=int(input("Enter number of entries : "))

t=list(map(float,input("Enter the values of time given : ").strip().split()))

v=list(map(float,input("Enter the values of capacitor voltage given : ").strip().split()))

T=float(input("Enter the time at which Vc is required : "))

t=np.array(t)

v=np.array(v)

h=t[1]-t[0]

r=(T-t[0])/h

dv=[]

dv.append(v[0])

diff=[]

for i in range (1,n):

    diff=np.diff(v)

    v=diff

    dv.append(v[0])

    print(dv)

m=1

sum=dv[0]

for k in range (1,n):

    m=m*(r-(k-1))

    sum=sum+((m*dv[k])/math.factorial(k))

print("At a time t=",T," msec. the capacitor voltage is",sum)