摘要: rep = ''with open('1.txt', 'r') as fp: contents = fp.read() #read()方法读取所有内容,得到字符串。readline()读取一行内容,得到字符串。readlines()读取所有内容,按行得到字符串列表 rep = contents.re 阅读全文
posted @ 2021-01-25 21:41 coffee~ 阅读(1518) 评论(0) 推荐(0)
摘要: 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分隔字符来代替默认 阅读全文
posted @ 2021-01-25 21:27 coffee~ 阅读(827) 评论(0) 推荐(0)