# ICode9

• ## 实验5 文件应用编程2022-05-17 01:33:19

实验任务3 with open('data3.txt','r',encoding='utf-8') as f: be=[] b=f.readlines() for i in b[1::]: i=eval(i.strip('\n')) be.append(i) print(f'原始数据:\n{be}') a=[] for i in be:

• ## 实验5 文件应用编程2022-05-17 00:04:00

task1_1.py with open('data1_1.txt', 'r', encoding = 'utf-8') as f: data = f.readlines() n = 0 for line in data: if line.strip('\n') == '': continue n += 1 print(f'共{n}行')

• ## 实验52022-05-17 00:03:33

with open('data3.txt', 'r', encoding='utf-8') as f: data = f.read().split('\n') yuanshishuju = data.pop(0) data1 = [eval(i) for i in data] data2 = [round(i) for i in data1] print(f'{yua

• ## 实验5 文件应用编程2022-05-17 00:02:10

with open('data3.txt','r',encoding='utf-8') as f: data=f.readlines() f.close() with open('data3_proxessed.txt','w',encoding='utf-8') as b: a=['四舍五入后数据'] for i in range(l

• ## 实验5 文件应用编程2022-05-17 00:00:19

#task3 with open('data3.txt','r',encoding='utf-8')as f1: with open('data3_processed.txt','w',encoding='utf-8')as f2: a=f1.read().split('\n') a.pop(0) c=[]

• ## 实验五2022-05-16 23:35:30

with open('data3.txt','r',encoding='utf-8')as f: data=f.read().split('\n') list1=data[1:11] print("原始数据：") print(list1) list2=[] for i in list1: num=float(i) y=int(num) x=num-y

• ## 实验5 文件应用编程2022-05-16 23:03:29

with open('D：/实验五数据/data3.txt','r+', encoding='UTF-8') as f: Z=[] Y=[] x=[] for i in f: x.append(i.strip('\n')) newx=x[1:11] for i in newx: y=float(i) Y.append(y)

• ## 实验五2022-05-16 23:01:10

task3def main():    passif __name__ == '__main__':    main()with open('data3.txt','r')as f:    data=f.read().split('\n')del data[0]a=list(data)b,m=[],[]for i in data:    i=float(i)    m.append(i)    b.append(round(

• ## 实验五2022-05-16 22:35:33

task3： with open('data3.txt','r',encoding='utf-8') as f1: data=f1.read().split('\n') x=[eval(i) for i in data[1:]] print(f'原始数据：\n{x}') y=[round(i) for i in x] print(f'四舍五入后数据：\n{y}') wit

• ## 实验五 文件应用编程2022-05-16 22:33:06

task3 1 with open('data3.txt','r+', encoding='UTF-8') as f: 2 x = [line.strip('\n') for line in f] 3 x.pop(0) 4 x_print = [eval(i) for i in x] 5 print(f"原始数据:\n{x_print}") 6 x_n

• ## 实验五2022-05-16 22:31:34

with open('data3.txt','r+', encoding='UTF-8') as f: num = [line.strip('\n') for line in f] num.pop(0) num_print = [eval(i) for i in num] print(f"原始数据:\n{num_print}") num_new = [round(

• ## 实验五：2022-05-16 22:01:14

with open('data1_2.txt', 'r', encoding = 'utf-8') as f: n = 0 for line in f: if line.isspace(): continue n += 1 print(f'共{n}行') with open('data2.txt', 'r',

• ## 实验五2022-05-16 21:31:41

task2 with open('C:\\Users\\86131\\Desktop\\实验5数据文件\\实验5数据文件\\data2.txt','r',encoding='utf-8') as f: data=f.read().split('\n') unique_line=[] for line in data: if data.count(line)==1: u

• ## 实验52022-05-16 21:31:23

with open('data3.txt','r+',encoding='utf-8')as f: a=[] for i in f: i=i.strip('\n') a.append(i) a.pop(0) b=[eval(i) for i in a] print(f'原始数据:\n{b}') c=[round(eval(i)) for i in a] p

• ## 实验5 文件应用编程2022-05-16 21:02:04

1,实验任务3 1 with open('data3.txt','r',encoding='utf-8') as f: 2 data=f.read() 3 a=[] 4 data=data.split('\n') 5 for i in range(len(data)): 6 if i!=0: 7 a.append(float(data[i])) 8 print(data[0],

• ## 实验五2022-05-16 20:33:04

task3 1 with open('data3.txt','r',encoding='utf-8') as f: 2 data=f.readlines() 3 f.close() 4 with open('data3_processed.txt','w',encoding='utf-8') as b: 5 a=['四舍五入后数据：']

• ## 实验52022-05-16 09:31:58

task3 1 with open('data3.txt','r+',encoding='utf-8')as f: 2 a=[] 3 for i in f: 4 i=i.strip('\n') 5 a.append(i) 6 a.pop(0) 7 b=[eval(i) for i in a] 8 print(f'原始数据:\n{b}')

• ## 实验5 文件应用编程2022-05-15 23:31:46

3.实验任务3   f=open('data3.txt','r') g=open('data3_processed.txt','w') a=[line.strip('\n') for line in f] a.pop(0) list1=[eval(j) for j in a] print(f'原始数据:\n{list1}') list2=[round(i) for i in lis

• ## 实验52022-05-15 22:35:27

task3.py with open('data3.txt', 'r', encoding='utf-8') as f: data = f.read().split('\n') yuanshishuju = data.pop(0) data1 = [eval(i) for i in data] data2 = [round(i) for i in data1] print(f

• ## 实验五2022-05-15 22:33:51

三 1 with open('data3.txt','r+',encoding='utf-8')as f: 2 a=[] 3 for i in f: 4 i=i.strip('\n') 5 a.append(i) 6 a.pop(0) 7 b=[eval(i) for i in a] 8 print(f'原始数据:\n{b}') 9 c

• ## 实验五 文件应用编辑2022-05-15 16:33:53

with open('data3.txt','r',encoding='utf-8')as f: t=f.readlines() p=[] for i in t: if t[0]==i: y='原始数据'+'\t'+'四舍五入后数据'+'\n' p.append(y)

• ## 实验五2022-05-15 16:01:32

with open('data5.txt','r',encoding='utf-8')as f: data = f.read() line_num = len(data.splitlines()) word_num = len(data.split()) space_num = data.count(' ') totall_num = len(data) print(f'行数：{line_num}\n单

• ## 实验52022-05-15 15:31:36

task3.py with open('data3.txt','r',encoding= 'utf-8') as f: data = f.readlines() d = [eval(line) for line in data[1:]] print('原始数据: ') print(d) t = [] for i in d: x = float(i) y = int(x) if x-y

• ## 52022-05-15 12:31:33

with open('data5.txt', 'r', encoding='utf-8') as f: data = f.read() line_num = len(data.splitlines()) word_num = len(data.split()) space_num = data.count(' ') totall_num = len(data) print(f'行数：{line_num}\

• ## 实验52022-05-14 20:03:36

task3 with open('data3.txt', 'r+', encoding='utf-8')as f: a = f.read().split('\n') a[0] = '原始数据' + '\t' + '四舍五入后数据' + '\n' for i in range(1, len(a)): i