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

  • 实验五

    task3 # Created on 刘杰的iPad. with open('data3.txt', 'r+', encoding = 'utf-8')as f: data = f.readlines() f.seek(0) f.truncate() data1 = [] for i in rang
    QiQi-sakura   2022-05-16 19:25   0   2
  • 实验五 文件应用编程

    task3.py 1 with open("data3.txt","r",encoding="utf-8") as f: 2 d=f.readlines() 3 flag=d 4 with open("data3_processed.txt","a",encoding="utf-8") as f1:
    昏汐   2022-05-16 19:05   0   4
  • 实验五

    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
    starry。   2022-05-16 12:26   1   5
  • 实验五

    实验任务3: 1 with open('data3.txt','r',encoding='utf-8')as f: 2 t=f.readlines() 3 p=[] 4 for i in t: 5 if t[0]==i: 6 y='原始数据'+'\t'+'四舍五入后数据'+'\n' 7 p.appe
    气工吴旭   2022-05-16 11:32   0   4
  • 实验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(
    shengaochajiaohuafei   2022-05-16 09:27   1   4
  • 实验5

    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 p
    蒜头小兲   2022-05-16 09:22   1   8
  • 实验5 文件应用编程

    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'原始数据:
    失聪的小毛   2022-05-15 23:23   0   7
  • 实验五

    task1 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
    橡皮小飒   2022-05-15 22:40   0   5
  • 实验五

    三 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
    爱冒险的小洋   2022-05-15 22:19   0   8
  • 实验5

    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] da
    h_ln   2022-05-15 22:16   0   2