input: def convert_number_to_base(x: int, base: int):
      """Convert a given integer x to a different base.
      Return the number as a string after conversion.
      Bases are restricted to values below 10.
      >>> convert_number_to_base(8, 3)
      '22'
      >>> convert_number_to_base(8, 2)
      '1000'
      >>> convert_number_to_base(7, 2)
      '111'
      """
output:     if base < 2 or base >= 10:
          raise ValueError("Base must be between 2 and 9")
      
      if x == 0:
          return "0"
      
      digits = []
      while x:
          digits.append(str(x % base))
          x //= base
      
      return ''.join(reversed(digits))