我想将 i 的值增加 6 以读取包含 4 个答案的问题和正确答案字符的文件,例如:
A
Which sport uses the term LOVE ?
Tennis
Golf
Football
Swimming
B
What is the German word for WATER ?
Wodar
Wasser
Werkip
Waski
我的代码:
fd = open(dFile)
lineas=fd.readlines()
fd.close()
for i in range(len(lineas)):
print "CA:"+lineas[i]+"Q:"+lineas[i+1]+"A1:"+lineas[i+2]+"A2:"+lineas[i+3]+"A3:"+lineas[i+4]+"A4:"+lineas[i+5];
i=i+6