import matplotlib.pyplot as plt
from random import choice

class RandomWalk:
    def __init__(self,steps = 100):
        self.steps = steps
        self.x_value = [0]
        self.y_value = [0]
    def get_xstep(self):
        x_dir = choice([-1,1])
        delta_x = choice([0,1,2,3,4,5,6])
        self.x += x_dir*delta_x
        return self.x
    def get_ystep(self):
        y_dir = choice([-1,1])
        delta_y = choice([0,1,2,3,4,5,6])
        self.y += y_dir*delta_y
        return self.y
    def walk(self):
        i = 0
        self.x = 0
        self.y = 0
        while i<= self.steps:
            i +=1
            self.x= self.get_xstep()
            self.y = self.get_ystep()
            if self.x == 0 and self.y ==0:
                continue
            self.x_value.append(self.x)
            self.y_value.append(self.y)

r = RandomWalk()
r.walk()
plt.plot(r.x_value,r.y_value)