01 2021 档案
摘要:rep = ''with open('1.txt', 'r') as fp: contents = fp.read() #read()方法读取所有内容,得到字符串。readline()读取一行内容,得到字符串。readlines()读取所有内容,按行得到字符串列表 rep = contents.re
阅读全文
摘要:def printmulti(): for i in range(1, 10): for j in range(1, i+1): t = str(j) + '*' + str(i) + '=' + str(i*j) if j < i: #print方法默认自动换行,参数中加上end分隔字符来代替默认
阅读全文