Define a function 'ratio' of two arrays gg and hh:
ratioi=gi+1−gihi+1−hi
where i=0,1,2...,N−1i=0,1,2...,N−1 and NN is the dimension of the arrays. Try to write your function in the best Python practices, e.g., with a docstring, and also such that it prints an error but does not crash when the function cannot be executed.