我正在制作一个基本程序,它有一个带有多项选择答案的测验.我想从.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)
奖金:网球!
| 归档时间: |
|
| 查看次数: |
36230 次 |
| 最近记录: |