Let's go back to the combat simulation example. We wrote code that printed an error message when the move
method received invalid arguments. We will rewrite the error-handling code to use exceptions. Replace the contents of the file vehicle.py in the combatsim package with the following code:
import sage.all class Ground_Vehicle(): """Base class for all ground vehicles""" def __init__(self, position): """Create a vehicle instance position (x,y) tuple of coordinates """ # Intialize position self._x = position[0] self._y = position[1] def move(self, direction, distance): """Move the vehicle. Arguments: direction floating-point number representing the compass angle of movement in degrees. North is 0, east is 90, south is 180, and west is 270. 0 <= direction <...