I am doing coursework where it requires me to make a Quiz programme where an account for a user is created and stored to a CSV along with personal information. It then requires me to read from a CSV file and read the questions and answers for the module to run and then it stores the test data to the CSV where all the account information is stored.
I have successfully written to the CSV however I am having a problem with reading correctly. The CSV is set up with 2 columns and 5 rows in A1, A2, A3, A4 and A5 is where the questions are stored and in B1, B2, B3, B4 and B5 is where the answers are stored for the question on the row. Currently I am attempting to print the Question into an input and then use an if statement to check it against the answer I have stored in the CSV.
Currently I am having problems with printing everything within the cell and I am having to use ranges. A section of my python code is as follows...
import csv
with open("questions.csv", 'r') as f:
for row in f:
question1 = row[0:94]
answer1 = row[95]
print(question1)
print(answer1)
How do I print the whole cell into the input without having to do the ranges in the row?