code: def forward(self, speed=1):
          
          if not 0 <= speed <= 1:
              raise ValueError('forward speed must be between 0 and 1')
          if isinstance(self.forward_device, DigitalOutputDevice):
              if speed not in (0, 1):
                  raise ValueError(
                      'forward speed must be 0 or 1 with non-PWM Motors')
          self.backward_device.off()
          self.forward_device.value = speed
docs: Drive the motor forwards.
  
          :param float speed:
              The speed at which the motor should turn. Can be any value between
              0 (stopped) and the default 1 (maximum speed) if *pwm* was
              :data:`True` when the class was constructed (and only 0 or 1 if
              not).