2han92hu0m1n9

导航

2018年6月20日 #

期末综合大作业:词频统计

摘要: #1. letFile = open('let.txt',mode="r",encoding='utf-8') letText = letFile.read() letFile.close() print(letText) #2. replaceList = [',','.',"'",'\n'] for c in replaceList: letText = letText.repla... 阅读全文

posted @ 2018-06-20 21:04 2han92hu0m1n9 阅读(119) 评论(0) 推荐(0) 编辑

2018年6月13日 #

递归,汉诺塔游戏

摘要: 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(9,'A','B','C') def hanoi(n,a,b,c): i... 阅读全文

posted @ 2018-06-13 21:02 2han92hu0m1n9 阅读(97) 评论(0) 推荐(0) 编辑

2018年6月6日 #

列表、元组、字典、集合的定义、操作与综合练习

摘要: 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 2han92hu0m1n9 阅读(115) 评论(0) 推荐(0) 编辑

2018年5月30日 #

文件操作

摘要: import turtle colors=['yellow','red','black','blue','purple','orange'] turtle.speed(10) for i in range(100): turtle.pencolor(colors[i%6]) turtle.forward(i) turtle.left(59) turtle.done()... 阅读全文

posted @ 2018-05-30 20:35 2han92hu0m1n9 阅读(157) 评论(0) 推荐(0) 编辑

2018年5月23日 #

字符串操作:凯撒密码。列表及其基本操作。

摘要: id='440682199901084345' 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') for i in range(12): print(98... 阅读全文

posted @ 2018-05-23 21:37 2han92hu0m1n9 阅读(219) 评论(0) 推荐(0) 编辑

字符串操作

摘要: id='440682199901084345' 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') for i in range(12): print(98... 阅读全文

posted @ 2018-05-23 20:59 2han92hu0m1n9 阅读(80) 评论(0) 推荐(0) 编辑

2018年5月16日 #

函数定义与使用,字符串类型

摘要: 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() for i in range (5): ... 阅读全文

posted @ 2018-05-16 21:33 2han92hu0m1n9 阅读(92) 评论(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:21 2han92hu0m1n9 阅读(94) 评论(0) 推荐(0) 编辑

2018年5月9日 #

for循环:用turtle画一颗五角星

摘要: 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-09 21:23 2han92hu0m1n9 阅读(240) 评论(0) 推荐(0) 编辑

2018年5月4日 #

程序执行流程/布尔类型与布尔:运算猜数字游戏;库的使用:turtle

摘要: myNumber = 9 while True: guess=int(input()) if guess > myNumber: print('>') elif guess >> import turtle >>> turtle.circle(50) >>> turtle.circle(100) >>> turtle.circle(150) ... 阅读全文

posted @ 2018-05-04 21:45 2han92hu0m1n9 阅读(142) 评论(0) 推荐(0) 编辑