def get_float(text):
    """
    :param text: message to display when asking for a number (str)
    :return: n, a number given by user (float)
    """
    while True:
        n = input(text)
        try:
            n = float(n)
            return n
        except ValueError:
            print("ValueError: not a number.\n")