在python中读取.DAT文件?

Mic*_*ood 5 python

我正在制作一个基本程序,它有一个带有多项选择答案的测验.我想从.DAT文件中访问数据.这是.DAT文件的基本布局.

Which sport uses the term LOVE ?
Tennis
Golf
Football
Swimming
A
Run Code Online (Sandbox Code Playgroud)

如何单独访问每一行?

mat*_*exx 10

for line in open(filename, 'r'):
    item = line.rstrip() # strip off newline and any other trailing whitespace
    ...
Run Code Online (Sandbox Code Playgroud)

奖金:网球!