def separateUnit(string):
    """
        Separates the unit and number in given string
        e.g. '1 em' will return (float(1), 'em')
    """
    # create an array of valid numbers (and '.')
    nums = ['.'] + [str(x) for x in range(10)]
    num_str = str()
    unit_str = str()
    # find first char in string that is not a number or '.', split the string on it
    for i in range(len(string)):
        if string[i] not in nums:
            num_str = string[:i-1]
            unit_str = string[i-1:]
    if num_str == str():
        num_str = string
    return float(num_str), unit_str