In this exercise, we are using Python to create data for a random walk. After creating the data, one has to use matplotlib to plot it. A random walk is a path having no clear direction. At each point or after a set of points, one has to decide either to move left or right.
Create a class named RandomWalk.py:
RandomWalk
no_of_steps: Int
x_values: List
y_values: List
fill_walk()
After generating data for the desired number of steps, one also has to plot it using a scatter plot. The output should be similar to this:
200
150
100
50
150
-100
-50
50