title: Random walk simulation in python 3.6
body: <p>I have been trying to simulate a random walk using the code below</p>
  
  <pre><code>import random
  
  
      def random_walk(n):
          """ Return coordiantes after 'n' block random walk"""
          x, y = 0, 0
          # y = 0
          for i in range(n):
              (dx, dy) = random.choice([(0, 1), (0, -1), (1, 0), (-1, 0)])
          x = x+dx
          y = y+dy
          return(x, y)
  
  
      for i in range(25):
          walk = random_walk(10)
          print(walk, "Distance from origin:",
                abs(walk[0]) + abs(walk[1]))
  </code></pre>
  
  <p>I am always getting output as 1.No matter how much i increase number of walks or
  number of blocks walked.I am not able to figure out what am i doing wrong</p>