摘要: f=open('son.txt',mode='r',encoding='utf-8') fText = f.read()print(fText)replaceList = ['?',',','.',';']for c in replaceList: fText = fText.replace(c,' 阅读全文
posted @ 2018-06-20 20:35 吴树生 阅读(95) 评论(0) 推荐(0) 编辑
摘要: f=open('son.txt',mode='r',encoding='utf-8')fText = f.read()print(fText)replaceList = ['?',',','.',';']for c in replaceList: bigText = bigText.replace( 阅读全文
posted @ 2018-06-13 21:24 吴树生 阅读(128) 评论(0) 推荐(0) 编辑
摘要: l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [85,65,55] d = {'Michael':85,'Bob':65,'Tracy':55 阅读全文
posted @ 2018-06-06 21:17 吴树生 阅读(411) 评论(0) 推荐(1) 编辑
摘要: fr=open('letter.txt',mode='r',encoding='utf-8')plaincode = fr.read()print('明文:'+plaincode)print('密文:',end='')open('letter.txt',mode='r',encoding='utf-8')for c in plaincode: print(chr (ord(c)+3),e... 阅读全文
posted @ 2018-05-30 20:48 吴树生 阅读(230) 评论(0) 推荐(0) 编辑
摘要: for i in range(12): print(9800+i,chr(9800+i)) id= '445221199803106993'area = id[0:6]birthday = id[3:10]sex = id[-1]print(area,birthday,sex)if (int(sex) % 2 == 0): print('girl')else: print('b... 阅读全文
posted @ 2018-05-23 20:25 吴树生 阅读(151) 评论(0) 推荐(0) 编辑
摘要: stuNum='201709080063'print('年级是:'+stuNum[0:4])print('专业编号是;+stuNum[4:9]')print('序号是;'+stuNum[-3:])IDNo= '445221199803106993'print('省市是:'+IDNo[0:2])pri 阅读全文
posted @ 2018-05-23 19:55 吴树生 阅读(99) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle 阅读全文
posted @ 2018-05-16 20:12 吴树生 阅读(168) 评论(0) 推荐(0) 编辑
摘要: import turtle # 设置初始位置 turtle.penup()turtle.left(90)turtle.fd(200)turtle.pendown()turtle.right(90) # 花蕊 turtle.fillcolor("red")turtle.begin_fill()turt 阅读全文
posted @ 2018-05-09 20:13 吴树生 阅读(245) 评论(0) 推荐(0) 编辑
摘要: import turtle# 设置初始位置 turtle.penup()turtle.forward(100)turtle.right(144)turtle.forward(100)turtle.right(144)turtle.forward(100)turtle.right(144)turtle 阅读全文
posted @ 2018-05-09 20:05 吴树生 阅读(158) 评论(0) 推荐(0) 编辑
摘要: number = 7while True: guess = int(input('输入一个数字\n')) if guess > number: input('比这个数大') elif guess < number: input('比这个数小') else: print('恭喜你答对了') break 阅读全文
posted @ 2018-05-02 20:30 吴树生 阅读(190) 评论(0) 推荐(0) 编辑