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

  • 实验五

    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
    我真是想笑   2022-05-15 15:54   0   5
  • 实验五

    1 1 with open('data3.txt','r',encoding='utf-8') as f : 2 with open('data3_processed.txt', 'w', encoding='utf-8') as f1: 3 data=f.read().strip().split(
    lsw()   2022-05-15 15:39   1   11
  • 实验5

    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 = []
    好运来。   2022-05-15 15:28   0   6
  • 实验5

    with open('D://a//data3.txt', 'r', encoding = 'utf-8') as f: data = f.read().split('\n') x=[] for line in data: if data.count(line)==1: x.append(line)
    曲珞阳   2022-05-15 14:59   0   6
  • 实验五 文件应用编程

    #tesk3.py 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
    刘思彤、   2022-05-15 14:40   0   7
  • 5

    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.co
    忆路凉心   2022-05-15 12:21   1   6
  • 实验五

    with 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') da
    杜雨萱   2022-05-15 11:35   1   17
  • 实验5 文件应用编程

    task3 1 with open('实验5/data3.txt', 'r+', encoding = 'utf-8')as f: 2 data = f.readlines() 3 f.seek(0) 4 f.truncate() #使用truncate()清除文件中所有内容 5 6 data1 =
    Kyle-K   2022-05-15 11:09   0   8
  • 实验5

    Task 3.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)
    Scavengercjw   2022-05-15 10:02   0   5
  • 实验5: 文件应用编程

    task2 思考:先用read从里面读取所有数据,再用split和join方法将空格和tap键除去 task 3 1 with open('C:\\Users\\柚子西虹\\Desktop\\Python 文件\\data3.txt', 'r+', encoding = 'utf-8') as f:
    可爱捏   2022-05-15 08:49   1   15