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

摘要: #1 bigFile= open('Back to December.txt', mode='r', encoding='utf-8') bigText=bigFile.read() bigFile.read() #2 replaceList=['?',',','.','!',':',"'",'"' 阅读全文
posted @ 2018-06-20 21:11 谢嘉慧 阅读(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:36 谢嘉慧 阅读(177) 评论(0) 推荐(0)

字符串操作

摘要: id= ' 440111199903260346' 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 = '201709090073' prin... 阅读全文
posted @ 2018-05-23 21:08 谢嘉慧 阅读(173) 评论(0) 推荐(0)

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

摘要: mynumber=50 while True: guess=float(input('请输入一个数字')) if guess>mynumber: print('数字猜大了') elif guess<mynumber: print('数字猜小了') else: print('恭喜你猜对了') break... 阅读全文
posted @ 2018-05-09 21:27 谢嘉慧 阅读(73) 评论(0) 推荐(0)

玫瑰

摘要: 3. 阅读全文
posted @ 2018-05-09 21:13 谢嘉慧 阅读(150) 评论(0) 推荐(0)

条件语句,while循环语句:完整的温度转换程序

摘要: while True: a = int(input('摄氏转华氏请按 1\n华氏转摄氏请按 2\n退出请按 3\n')) if a==1: c = float(input('请输入摄氏温度:')) f = c*9/5+32 print('摄氏{:.2f}的华氏为{:.2f}\n'.format(c, 阅读全文
posted @ 2018-04-25 21:39 谢嘉慧 阅读(173) 评论(0) 推荐(0)

理解数据类型与数学运算:求和、温度转换

摘要: 温度转换 阅读全文
posted @ 2018-04-18 21:46 谢嘉慧 阅读(98) 评论(0) 推荐(0)

输入、输出与Mad Libs 游戏

摘要: name1=input('请输入你的名字') name2=input('再输入你的名字') print('粉丝{}终于跟偶像{}握手了,粉丝激动地说:我会一直支持你的!,偶像微微一笑说:谢谢你!'.format(name1,name2)) 阅读全文
posted @ 2018-04-18 21:10 谢嘉慧 阅读(263) 评论(0) 推荐(0)