def check_height(val):
    """hgt (Height) - a number followed by either cm or in:
    If cm, the number must be at least 150 and at most 193.
    If in, the number must be at least 59 and at most 76.
    """
    units = val[-2:]
    if units == "cm":
        return 150 <= int(val[:-2]) <= 193
    elif units == "in":
        return 59 <= int(val[:-2]) <= 76
    else:
        return False