- 博客(9)
- 收藏
- 关注
转载 期末综合大作业:词频统计
yaFile = open('ya.txt','r',encoding= 'utf-8') yaText = yaFile.read() yaFile.close() print(yaText) replacelist = [',',"'",'\n'] for c in replacelist: yaText = yaText.replace(c,' ') ...
2018-06-18 19:41:00 119
转载 列表的应用
l = [['Apple','Google','Microsoft'],\ ['Java','Python','Ruby','PHP'],\ ['Adam','Bart','Lisa']\ ] names= ['Michael','Bob','Tracy'] #list print(names[1]) scores = [95,...
2018-06-04 15:19:00 91
转载 字符串及其操作
plainText = input('message:') for c in plainText: print(chr(ord(c)+5)) plainText = input('message:') for c in plainText: print(chr(ord(c)-5)) for i in ra...
2018-05-21 15:18:00 70
转载 while循环与 for循环
import turtle turtle.setup(600,400,0,0) turtle.bgcolor('blue') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle.goto(x,y) turtl...
2018-05-14 15:17:00 64
转载 星星
import turtle turtle.setup(600.,600,0,0) turtle.bgcolor('blue') turtle.color('red') turtle.fillcolor('red') turtle.begin_fill() for i in range(5): turtle.forward(100) turtle.rig...
2018-05-07 16:39:00 80
转载 guess games
import turtle # 设置初始位置 turtle.penup() turtle.left(90) turtle.fd(200) turtle.pendown() turtle.right(90) # 花蕊 turtle.fillcolor("blue") turtle.begin_fill() turtle.circle(10, 180) ...
2018-05-07 15:25:00 149
转载 条件语句,while循环语句:完整的温度转换程序
while True: a = input('1:摄氏温度转为华氏温度请按\n2:华氏温度转为摄氏温度请按\n3:退出\n') if a =='1': c = float(input('请输入华氏温度:')) f = c*9/5+32 print('{:.2f}摄氏温度转为华氏温度为:{:.2f}\n'...
2018-04-23 16:58:00 213
转载 理解数据类型与数学运算:摄氏温度与华氏温度的相互转换
c = float(input('请输入华氏温度:')) f = c*9/5+32 print('{:.2f}摄氏温度转为华氏温度为:{:.2f}'.format(c,f)) f = float(input('请输入摄氏温度:')) c = 5/9*(f-32) print('{:.2f}华氏温度转为摄氏温度为:{:.2f}'.format(f,...
2018-04-23 16:45:00 91
转载 Mad Libs
name1 = input('请输入一个名字:') name2 = input('再输入一个名字:') sentence = input('请输入一句话:') name3 = input('再输入一个名字:') print('当{}说,京都和神户产生了远距离的恋爱,{}微笑着说{},远在天边的{},笑了'.format(name1,name2,sentence,name3...
2018-04-16 16:58:00 75
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人