摘要: 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,' ') print(yaText) ... 阅读全文
posted @ 2018-06-18 19:41 梁晓兵 阅读(148) 评论(0) 推荐(0) 编辑
摘要: l = [['Apple','Google','Microsoft'],\ ['Java','Python','Ruby','PHP'],\ ['Adam','Bart','Lisa']\ ] names= ['Michael','Bob','Tracy'] #list print(names[1]) scores = [95,75,85] #list ... 阅读全文
posted @ 2018-06-04 15:19 梁晓兵 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 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 range(12): print(98... 阅读全文
posted @ 2018-05-21 15:18 梁晓兵 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 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) turtle.pendown() def ... 阅读全文
posted @ 2018-05-14 15:17 梁晓兵 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 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): tur 阅读全文
posted @ 2018-05-07 16:39 梁晓兵 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 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) turtle.circle(25, 11... 阅读全文
posted @ 2018-05-07 15:25 梁晓兵 阅读(118) 评论(0) 推荐(0) 编辑
摘要: while True: a = input('1:摄氏温度转为华氏温度请按\n2:华氏温度转为摄氏温度请按\n3:退出\n') if a =='1': c = float(input('请输入华氏温度:')) f = c*9/5+32 print('{:.2f}摄氏温度转为华氏温度为:{:.2f}\ 阅读全文
posted @ 2018-04-23 16:58 梁晓兵 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 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,c)) 阅读全文
posted @ 2018-04-23 16:45 梁晓兵 阅读(165) 评论(0) 推荐(0) 编辑
摘要: name1 = input('请输入一个名字:') name2 = input('再输入一个名字:') sentence = input('请输入一句话:') name3 = input('再输入一个名字:') print('当{}说,京都和神户产生了远距离的恋爱,{}微笑着说{},远在天边的{}, 阅读全文
posted @ 2018-04-16 16:58 梁晓兵 阅读(208) 评论(0) 推荐(0) 编辑