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

  • 实验五

    task3: with open('data3.txt','r+', encoding='UTF-8') as f: x = [line.strip('\n') for line in f] x.pop(0) x_print = [eval(i) for i in x] print(f"原始数据:\
    MeiKoY   2022-05-17 19:14   0   3
  • 实验5

    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(
    青桔水溶C   2022-05-17 15:54   0   1
  • 实验五

    with open('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
    朗格里格朗   2022-05-17 15:28   0   1
  • 实验5

    task1 1 task1 2 task1 3 task1 4 task2 task3 task4 task5
    廖一头雾水   2022-05-17 15:24   0   2
  • 实验5

    with open('data1_1.txt', 'r', encoding='utf-8') as f: n=0 for line in f: # 逐行遍历处理 if line.strip('\n') =='': continue n+=1 print(f'共{n}行') with open('d
    思杰   2022-05-17 15:14   0   2
  • 实验五

    任务3 with open('C:\\Users\\肖鑫\\Desktop\\实验5数据文件\\实验5数据文件\\data3.txt','r+',encoding='utf-8') as f: data = f.readlines() data0 = [line.split() for line i
    清橙往忆   2022-05-17 14:30   0   1
  • 实验五

    #task3.py with open('data3.txt', 'r', encoding='utf-8') as f: data = f.read().strip() a = data.split('\n') y = a.pop(0) b = [] for i in a: x = eval(i)
    bamboosama   2022-05-17 13:10   0   3
  • 实验5文件应用编程

    1.实验任务1 task1_1.py 1 with open('data1_1.txt','r',encoding='utf-8')as f: 2 data=f.readlines() 3 4 n=0 5 for line in data: 6 if line.strip('\n')=='': 7
    张满月的衣橱   2022-05-17 13:04   0   5
  • 实验五

    1 with open ('data3.txt','r',encoding='utf-8')as f: 2 a=f.readlines() 3 del a[0] 4 b=[] 5 c=[] 6 for i in a: 7 if float(i.replace('\n',''))-int(float(
    pray4hell   2022-05-17 12:37   0   0
  • 实验五

    task3 with open('C:\\Users\\Administrator\\Desktop\\实验5\\实验5数据文件\\data3.txt','r',encoding='utf-8') as f: data=f.read().split('\n') list1=[] list2=[] f
    杪秋有四0904   2022-05-17 12:28   0   6