1 2 3 4 5 6 7 8 9 10 11 12 13 14
import random # N, S, W, E choices = [(0, 1), (0, -1), (-1, 0), (1, 0)] def rand_walk(n, p0=[]): if p0 is None: p0 = [0, 0] pass