一:编写程序
现如今有4组秒表记录的数据,分别如下:
james.txt:2-34,3:21,2.34,2.45,3.01,2:01,2:01,3:10,2-22
julie.txt:2.59,2.11,2:11,2:23,3-10,2-23,3:10,3.21,3-21
mikey.txt:2:22,3.01,3:01,3.02,3:02,3.02,3:22,2.49,2:38
sarah.txt:2:58,2.58,2:39,2-25,2-55,2:54,2.18,2:55,2:55
1.需要从各个文件将数据读入各自的列表,编写一个小程序,处理每个文件,为每个数据创建一个列表,并在屏幕上显示这些列表
james.txt
In [1]: with open('james.txt',"r") as jam: ...: data=jam.readline() ...: james=data.strip().split(",") #strip():去除空白换行符#split():