a01:01-24-2011:s1
a03:01-24-2011:s2
a02:01-24-2011:s2
a03:02-02-2011:s2
a03:03-02-2011:s1
a02:04-19-2011:s2
a01:05-14-2011:s2
a02:06-11-2011:s2
a03:07-12-2011:s1
a01:08-19-2011:s1
a03:09-19-2011:s1
a03:10-19-2011:s2
a03:11-19-2011:s1
a03:12-19-2011:s2
我有一个数据列表,保存在一个txt文件中,格式为“动物名称:日期:位置”。我需要读取这个文件来回答问题。目前为止,我的进展如下:
text_file=open("animal data.txt", "r") #open the text file and reads it.
我知道如何读取一行,但是由于这里有多行文本,我不确定如何读取每一行。