title: Moving in 2D coordinate plane, keeping track of position and distance from the origin
body: <p>So i'm  trying  to make a code (mainly using class) that would allow me to make a robot move (imagine there's a coordinate plane) starting from the center (0,0) UP, DOWN, LEFT or RIGHT. We were task to have the program repeatedly ask for a string input to identify the direction and distance movement, and then output the current position and euclidean distance of the robot from the origin. We shall assume that the input for the direction and distance is separated by a space (e.g. “UP 5”, “LEFT 6”). And if the input is invalid (e.g. no direction or no number), print “Invalid Input”. Sample output is shown below.</p>
  
  <pre><code>Input (Direction Distance): UP 5
  Position = (0, 5.0)
  Distance = 5.0
  
  Input (Direction Distance): LEFT 2
  Position = (-2.0, 5.0)
  Distance = 5.3851...
  </code></pre>
  
  <p>Here is the solution that i tried:</p>
  
  <pre><code>class Robot(object):
      def __init__(self, n=(0,0)):
          self.n = n
          post = list(n)
          self.x = post[0]
          self.y = post[1]
  
      def movement(self,a):
          direction = self.a[0]
          move = self.a[1]
          if direction == "UP":
              y_d = self.y + move.y
          elif direction == "DOWN":
              y_d = self.y - move.y
          elif direction == "RIGHT":
              x_d = self.x + move.x
          elif direction == "LEFT":
              x_d = self.x - move.x
          return (x_d**2 + y_d**2) **0.5
  
  
  direction_list = ["UP","DOWN","LEFT","RIGHT"]      
  while True:
      question = input('Do you want to enter a move? (YES/NO)')
      while question == 'YES' or question == "Yes" or question == "yes":
          a = input('Input DIRECTION AND DISTANCE').split()
          if a[0] in direction_list and a[1].isnumeric():
              #direction = a[0]
              #distance = a[1]
              print(Robot(a))
          else: 
              print('Invalid Input')  
      break
  </code></pre>
  
  <p>When i try to run it, i always get this:</p>
  
  <pre><code>Input DIRECTION AND DISTANCEUP 5
  &lt;__main__.Robot object at 0x000001EB1DEA9F60&gt;
  </code></pre>
  
  <p>Will somebody explain what i'm doing wrong?</p>