def input_tape_string(turing_machine):
    """
    Get the input tape's string from the user.
    :param turing_machine: The Turing's machine. Used to check if the inserted tape is valid.
    :return: The given tape.
    """
    tape = list(input("Insert an input for the machine: "))
    fault = False

    for char in tape:
        if not turing_machine.is_symbol(char):
            fault = True

    while fault:
        tape = input("Error. Insert a valid input for the machine: ").split()
        fault = False
        for char in tape:
            if not turing_machine.is_symbol(char):
                fault = True

    return tape