Clean up continuous mountain car environment
diff --git a/gym/envs/classic_control/continuous_mountain_car.py b/gym/envs/classic_control/continuous_mountain_car.py
index 8f34b268840..5ffc97685c1 100644
--- a/gym/envs/classic_control/continuous_mountain_car.py
+++ b/gym/envs/classic_control/continuous_mountain_car.py
@@ -22,13 +22,14 @@
 from gym import spaces
 from gym.utils import seeding
 
+
 class Continuous_MountainCarEnv(gym.Env):
     metadata = {
         'render.modes': ['human', 'rgb_array'],
         'video.frames_per_second': 30
     }
 
-    def __init__(self, goal_velocity = 0):
+    def __init__(self, goal_velocity=0):
         self.min_action = -1.0
         self.max_action = 1.0
         self.min_position = -1.2
@@ -38,15 +39,26 @@ def __init__(self, goal_velocity = 0):
         self.goal_velocity = goal_velocity
         self.power = 0.0015
 
-        self.low_state = np.array([self.min_position, -self.max_speed], dtype=np.float32)
-        self.high_state = np.array([self.max_position, self.max_speed], dtype=np.float32)
+        self.low_state = np.array(
+            [self.min_position, -self.max_speed], dtype=np.float32
+        )
+        self.high_state = np.array(
+            [self.max_position, self.max_speed], dtype=np.float32
+        )
 
         self.viewer = None
 
-        self.action_space = spaces.Box(low=self.min_action, high=self.max_action,
-                                       shape=(1,), dtype=np.float32)
-        self.observation_space = spaces.Box(low=self.low_state, high=self.high_state,
-                                            dtype=np.float32)
+        self.action_space = spaces.Box(
+            low=self.min_action,
+            high=self.max_action,
+            shape=(1,),
+            dtype=np.float32
+        )
+        self.observation_space = spaces.Box(
+            low=self.low_state,
+            high=self.high_state,
+            dtype=np.float32
+        )
 
         self.seed()
         self.reset()
@@ -61,20 +73,23 @@ def step(self, action):
         velocity = self.state[1]
         force = min(max(action[0], -1.0), 1.0)
 
-        velocity += force*self.power -0.0025 * math.cos(3*position)
+        velocity += force * self.power - 0.0025 * math.cos(3 * position)
         if (velocity > self.max_speed): velocity = self.max_speed
         if (velocity < -self.max_speed): velocity = -self.max_speed
         position += velocity
         if (position > self.max_position): position = self.max_position
         if (position < self.min_position): position = self.min_position
-        if (position==self.min_position and velocity<0): velocity = 0
+        if (position == self.min_position and velocity < 0): velocity = 0
 
-        done = bool(position >= self.goal_position and velocity >= self.goal_velocity)
+        # Convert a possible numpy bool to a Python bool.
+        done = bool(
+            position >= self.goal_position and velocity >= self.goal_velocity
+        )
 
         reward = 0
         if done:
             reward = 100.0
-        reward-= math.pow(action[0],2)*0.1
+        reward -= math.pow(action[0], 2) * 0.1
 
         self.state = np.array([position, velocity])
         return self.state, reward, done, {}
@@ -92,9 +107,8 @@ def render(self, mode='human'):
 
         world_width = self.max_position - self.min_position
         scale = screen_width/world_width
-        carwidth=40
-        carheight=20
-
+        carwidth = 40
+        carheight = 20
 
         if self.viewer is None:
             from gym.envs.classic_control import rendering
@@ -109,19 +123,23 @@ def render(self, mode='human'):
 
             clearance = 10
 
-            l,r,t,b = -carwidth/2, carwidth/2, carheight, 0
-            car = rendering.FilledPolygon([(l,b), (l,t), (r,t), (r,b)])
+            l, r, t, b = -carwidth / 2, carwidth / 2, carheight, 0
+            car = rendering.FilledPolygon([(l, b), (l, t), (r, t), (r, b)])
             car.add_attr(rendering.Transform(translation=(0, clearance)))
             self.cartrans = rendering.Transform()
             car.add_attr(self.cartrans)
             self.viewer.add_geom(car)
-            frontwheel = rendering.make_circle(carheight/2.5)
+            frontwheel = rendering.make_circle(carheight / 2.5)
             frontwheel.set_color(.5, .5, .5)
-            frontwheel.add_attr(rendering.Transform(translation=(carwidth/4,clearance)))
+            frontwheel.add_attr(
+                rendering.Transform(translation=(carwidth / 4, clearance))
+            )
             frontwheel.add_attr(self.cartrans)
             self.viewer.add_geom(frontwheel)
-            backwheel = rendering.make_circle(carheight/2.5)
-            backwheel.add_attr(rendering.Transform(translation=(-carwidth/4,clearance)))
+            backwheel = rendering.make_circle(carheight / 2.5)
+            backwheel.add_attr(
+                rendering.Transform(translation=(-carwidth / 4, clearance))
+            )
             backwheel.add_attr(self.cartrans)
             backwheel.set_color(.5, .5, .5)
             self.viewer.add_geom(backwheel)
@@ -130,15 +148,19 @@ def render(self, mode='human'):
             flagy2 = flagy1 + 50
             flagpole = rendering.Line((flagx, flagy1), (flagx, flagy2))
             self.viewer.add_geom(flagpole)
-            flag = rendering.FilledPolygon([(flagx, flagy2), (flagx, flagy2-10), (flagx+25, flagy2-5)])
-            flag.set_color(.8,.8,0)
+            flag = rendering.FilledPolygon(
+                [(flagx, flagy2), (flagx, flagy2 - 10), (flagx + 25, flagy2 - 5)]
+            )
+            flag.set_color(.8, .8, 0)
             self.viewer.add_geom(flag)
 
         pos = self.state[0]
-        self.cartrans.set_translation((pos-self.min_position)*scale, self._height(pos)*scale)
+        self.cartrans.set_translation(
+            (pos-self.min_position) * scale, self._height(pos) * scale
+        )
         self.cartrans.set_rotation(math.cos(3 * pos))
 
-        return self.viewer.render(return_rgb_array = mode=='rgb_array')
+        return self.viewer.render(return_rgb_array=mode == 'rgb_array')
 
     def close(self):
         if self.viewer:

Improve readability and mostly adhere to PEP-8.
I left the one-line ifs (l.77-81) as is.