def check(x):
    """
    This function is to check if input x is a valid number

    Parameters
    ------
    x : string

    Return
    ------
    boolean: True if x is a valid number, else False

    """

    if '-' in x:
        x = x.lstrip('-')
    if '.' in x:
        x = x.replace('.','0',1)
    return x.isnumeric()