摘要: #1 seeFile = open('see.txt', mode='r',encoding='utf-8') seeText = seeFile.read() #从文件里读出全部文本 字符串 seeFile.close() print(seeText) #2 replaceList = [',','.',"'",'/n'] for c in replaceList: seeTex... 阅读全文
posted @ 2018-06-13 21:01 木木dududu 阅读(209) 评论(0) 推荐(0) 编辑
摘要: def hanoi(n,a,b,c): if n ==1: print(n,a+'->'+c) else: hanoi(n-1,a,c,b) print(n,a+'->'+c) hanoi(n-1,b,a,c) hanoi(10,'A','B','c') 阅读全文
posted @ 2018-06-13 20:59 木木dududu 阅读(130) 评论(0) 推荐(0) 编辑
摘要: l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [95,75,85] d = {'Michael':95,'Bob':75,'Tracy':85 阅读全文
posted @ 2018-06-06 21:32 木木dududu 阅读(124) 评论(0) 推荐(0) 编辑
摘要: fr = open('letter.txt',mode='r',encoding='utf-8') plaincode = fr.read() fr.close fw = open('c_letter.txt',mode='a',encoding='utf-8') for c in plaincode: fw.write(chr(ord(c)+3)) fr = open... 阅读全文
posted @ 2018-05-30 21:23 木木dududu 阅读(106) 评论(0) 推荐(0) 编辑
摘要: id='420682199807012608' area = id[0:6] birthday = id[6:14] sex = id[-2] print(area,birthday,sex) if (int(sex) % 2 == 0): print('girl') else: print('boy') stuNum = '201709080026' print('年... 阅读全文
posted @ 2018-05-23 21:32 木木dududu 阅读(102) 评论(0) 推荐(0) 编辑
摘要: stuNum = '201709080026' import turtle turtle.bgcolor("red") turtle.fillcolor("yellow") turtle.color('yellow') turtle.speed(10) turtle.begin_fill() turtle.up() turtle.goto(-600,220) turtle.down()... 阅读全文
posted @ 2018-05-16 23:03 木木dududu 阅读(159) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.bgcolor("red") turtle.fillcolor("yellow") turtle.color('yellow') turtle.speed(10) turtle.begin_fill() turtle.up() turtle.goto(-60 阅读全文
posted @ 2018-05-16 20:20 木木dududu 阅读(60) 评论(0) 推荐(0) 编辑
摘要: import turtle # 设置初始位置 turtle.penup() turtle.left(90) turtle.fd(200) turtle.pendown() turtle.right(90) # 花蕊 turtle.fillcolor("red") turtle.begin_fill() turtle.circle(10, 180) turtle.circle(25, 110)... 阅读全文
posted @ 2018-05-16 20:01 木木dududu 阅读(203) 评论(0) 推荐(0) 编辑
摘要: number = 7 while True: guess = int(input( '请输入一个数\n')) if guess > number: input('比这个数字大') elif guess < number: input('比这个数小') else: ... 阅读全文
posted @ 2018-05-02 21:43 木木dududu 阅读(121) 评论(0) 推荐(0) 编辑
摘要: a=input('输入一个数字') b=input('再输入一个数字') sum2=int(a)+int(b) print('两数之和;{}'.format(sum2)) a=input('输入摄氏度') sum2=int(a)*9/5+32 print('华氏温度;{}'.format(sum2)) 阅读全文
posted @ 2018-04-25 21:15 木木dududu 阅读(67) 评论(0) 推荐(0) 编辑