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

  • 实验5 文件应用编程

    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
    velpro1129   2022-05-16 23:44   0   5
  • 实验5

    1 # task1_1.py 2 # 统计文件data1_1.txt行数 (不包括空白行) 3 # data1_1.txt中的空白行都是由\n构成的空白行 4 with open('data1_1.txt', 'r', encoding = 'utf-8') as f: 5 data = f.rea
    lsqb27   2022-05-16 23:40   1   2
  • 实验5

    1 with open('data3.txt', 'r', encoding='utf-8') as f: 2 data = f.read().strip().split('\n') 3 data[0] = '原始数据' + '\t' + '四舍五入后数据' + '\n' 4 for i in ra
    宋烨   2022-05-16 23:28   0   2
  • 实验五

    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=f
    WA自动机!   2022-05-16 23:18   1   4
  • 实验五

    实验一: 1 with open('data3.txt','r',encoding='utf-8') as f: 2 data=f.readlines() 3 f.close() 4 with open('data3_proxessed.txt','w',encoding='utf-8') as b
    张玮珊   2022-05-16 23:16   0   4
  • 实验五

    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"原始数据:
    10309   2022-05-16 23:14   0   3
  • 实验五-文件应用编程

    实验五-3with open('data3.txt','r',encoding='utf-8') as f : with open('data3_processed.txt', 'w', encoding='utf-8') as f1: data=f.read().strip().split('\n
    hhkki#   2022-05-16 23:12   0   2
  • 实验5

    with open('data3.txt','r',encoding='utf-8')as f: data=f.read().strip().split('\n') data[0]='原始数据'+'\t'+'四舍五入后数据'+'\n' for i in range(1,len(data)): dat
    唔a   2022-05-16 23:06   1   5
  • 实验5

    实验任务3 task3.py with open('data3.txt','r',encoding='utf-8') as f: l = f.readlines() ly = [] lx = ['四舍五入后的数据'] ls = [] for i in l: s = i.strip('\n') ly.
    llzyj   2022-05-16 23:05   0   1
  • 实验五 文件应用编程

    task_3 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{
    写作业的xzy   2022-05-16 23:03   1   2