def is_number(c):
    """
    Return True if the character /c/ can form part of a number in esc.
    Raise AssertionError if the string is not exactly one character.

    >>> is_number('0')
    True

    >>> is_number('5')
    True

    >>> is_number('.')
    True

    >>> is_number('a')
    False

    >>> is_number('168.3')
    Traceback (most recent call last):
      ...
    AssertionError: c must be a single character

    >>> is_number('')
    Traceback (most recent call last):
      ...
    AssertionError: c must be a single character
    """
    assert len(c) == 1, 'c must be a single character'
    return '0' <= c <= '9' or c in ('.', '_', 'e')
