import random
import matplotlib.pyplot as plt
def random_walk(x0,y0,h,n):
x=x0
y=y0
xsteps=[]
ysteps=[]
xsteps.append(x)
ysteps.append(y)
for t in range(1,n+1,1):
rn=random.randint(0,3)
if rn==0:
x=x-h
elif rn==1:
x=x+h
elif rn==2:
y=y-h
else:
y=y+h
xsteps.append(x)
ysteps.append(y)
return [xsteps,ysteps]
s=random_walk(2,2,0.01,5000)
a=plt.plot(s[0],s[1])