我想在6增加i的值來讀取有4個答案和正確答案的文字問題的文件,例如:我該如何增加一個for?
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
爲什麼這麼多downvotes? –