title: "ZeroDivisionError: division by zero"
body: <p>I am a beginner working with Python3.6 and I have no idea why my code will not work properly. Your feedback/help is greatly appreciated. </p>
  
  <p>My instructions for the DriveTo function are as follows: </p>
  
  <p>Now, add a Car method driveTo. It should take two additional parameters, namely, the x and y coordinates of a location for the car to attempt to move. If the car has enough gas to make the trip, the car should be moved, the amount of gas remaining should be updated, and the method should return True. If the car does not have enough gas, it should not be moved or changed at all, and the method should return False</p>
  
  <p>Here is my current code:</p>
  
  <pre><code>import math 
  
  class Car:
      def __init__( self , mpg , fuel , money ):
          self.mpg = mpg
          self.fuel = fuel
          self.money = money
  
      #return current location of car in two element list
      def getLocation( self ):
          return [ self.x , self.y ]
  
      #returns the number of gallons left in the car 
      def getGas( self ):
          self.fuel -= 1
          return self.fuel
  
      #returns how much gas the car needs to be at capacity 
      def getToFill( self ):
          current_tank =  self.getGas() 
          gas_needed = ( self.fuel - current_tank )
          return gas_needed
  
      #return true or false if enough gas
      def driveTo( self , x , y ):
          self.x = x
          self.y = y
          miles_pg = (self.mpg / self.getToFill())
          miles = math.sqrt( ( self.x - x )**2 + ( self.y - y )**2 )
  
  
  
          if miles &gt;= miles_pg:
              return True
          else:
              return False
  </code></pre>