Random walk generator - looking for optimizations (Python)
Here's one suggestion; other readers will probably offer more.
Several times, you need to get an integer from the user. You
could create a function to handle such details. The code
below shows what the function might look light and how you
would use it.
def int_from_user(prompt):
    while True:
        try:
            n = int(input(prompt + ' '))
            if n &gt; 0:
                return n
            else:
                raise ValueError()
        except ValueError:
            print('Invalid input! Enter a positive number.')

steps = int_from_user('How many steps should be done?')
print(steps)