Python - Improvements to my CSV string finder
<p>I have a CSV file that has two columns in - one for problems and the other for answers. However, it only works when you enter the string EXACTLY as it appears in the CSV file. How can I split the string or make the program scan the CSV for the keyword only?</p>

<p>My code is as follows:</p>

<pre><code>def PhoneSupport(): #Second Subprogram created/defined, the main body of the whole program.
    error = 1
    f = open("PhoneSupp CSV.csv", "r") #Opens the CSV file
    rows = re.split("\n", f.read())

    userInput = input("What has happened to your phone?") #Asks the user the desired question
    randInt = random.randint(0,9999) #Random integer used later on

    if userInput == "":
        print("You have not entered any problem.") #Tells the user no problem has been entered and therefore are asked to restart the program
        RestartProgram()

    for index, row in enumerate(rows): #Loop that splits the rows into cells
        cells = row.split(',')
        if userInput in cells: #Searches the CSV file for the matching string (in lower case)
            error = 0
            print("A Solution has been found!:")
            print("")
            print(cells) #Prints the solution, if one has been found
            print("")
            break
        elif userInput == "":
            error = 1
        else:           #If it doesn't, then the error variable is set to 1 for the code below
            error = 1

    if error == 1:
        print("No Solution has been found - Your support ticket is: " + str(randInt)) #Prints error message and the random integer created earlier to act as a support ticket
        print("")
        RestartProgram() #Asks the user to restart
    elif error == 0:
        RestartProgram() #Asks the user to restart

PhoneSupport() #Starting the PhoneSupport subprogram
</code></pre>