计算机程序设计(Python)-21级 (南京信息工程大学)

  • 实验五

    1 with open('D://aa//data3.txt','r',encoding='utf-8')as f: 2 data=f.read().split('\n') 3 list1=data[1:11] 4 print("原始数据:") 5 print(list1) 6 list2=[] 7
    是个f个人   2022-05-14 23:53   0   8
  • 实验5

    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)):
    东揚   2022-05-14 19:48   0   8
  • 实验五

    #task.3with open('data3.txt', 'r+', encoding = 'utf-8') as f,open('data3_processed.txt', 'r+', encoding = 'utf-8') as ff: num=[line.strip('\n') for li
    云处安   2022-05-14 17:03   0   9
  • 实验5 文件应用编程

    5.3 with open('5//data3.txt','r')as f: data=f.read().split('\n') del data[0] a=list(map(float,data)) b=[] for i in a: if i-int(i)<=0.4: b.append(int(i
    花二   2022-05-14 16:25   0   14
  • 实验五

    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=['四舍五入后数据
    张杰的   2022-05-14 16:21   0   5
  • 实验5 文件应用编程

    1 #task3.py 2 with open('data3.txt','r',encoding='utf-8') as f : 3 with open('data3_processed.txt', 'w', encoding='utf-8') as f1: 4 data=f.read().stri
    靠谱一星   2022-05-14 16:01   0   11
  • 实验5:文件应用编程

    任务实验1:统计文件行数(不包括空白行): task1.1: 1 with open('data1_1.txt','r',encoding='utf-8') as f: 2 data=f.readlines() 3 n=0 4 for line in data: 5 if line.strip('\
    怡宝子   2022-05-14 15:45   1   5
  • 实验5

    with open('data1_2.txt','r',encoding='utf-8')as f: n=0 for line in f : if line.strip()=='': continue n+=1 print(f'共{n}行') with open('data1_1.txt', 'r'
    Rua!Rua!Rua!   2022-05-14 12:32   1   6
  • 实验5 文件应用编程

    task 3 1 with open ('data3.txt','r',encoding='utf-8') as f: 2 data = f.read() 3 data = data.split('\n') 4 m = ['{:20}'.format(i) if i == '原始数据' else '
    熊猫小丸子   2022-05-14 12:15   2   14
  • 实验5 文件应用编程

    一、实验内容 3.实验任务3 task3.py: 1 with open("D:\桌面\实验5数据文件\实验5数据文件\data3.txt",'r',encoding='utf-8') as f1: 2 with open("D:\桌面\实验5数据文件\实验5数据文件\data3_processed
    Dimple$   2022-05-14 11:02   0   11