摘要: #1, letFile = open('let.txt','r') letTest = letFile.read() letFile.close() print(letTest) #2, print(letTest.replace(',',' ')) print(letTest.replace("' 阅读全文
posted @ 2018-06-20 21:35 王滢 阅读(189) 评论(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(2,'A','B','C') 阅读全文
posted @ 2018-06-13 21:20 王滢 阅读(167) 评论(0) 推荐(0) 编辑
摘要: l = ['AA','BB','CC'] l.append('BB') l.pop() print(1) t = ('AA','BB','CC') scores = [88,99,100] d = {'AA':88,'BB':99,'CC':100} d['BB'] = 95 d['Want'] = 阅读全文
posted @ 2018-06-06 21:31 王滢 阅读(167) 评论(0) 推荐(0) 编辑
摘要: fr = open('88.txt',mode='r', encoding='utf-8') planincode = fr.read() print('明文:' + planincode) print('密文:',end='') for c in planincode: print(chr(ord(c)+3),end='') fr = open('88.txt',mode='r... 阅读全文
posted @ 2018-05-30 21:22 王滢 阅读(171) 评论(0) 推荐(0) 编辑
摘要: stuNum = '201709090022' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo= '44000202199812010027' print('省市是:'+IDNo[0:2]) print('生日是:'+IDNo[-8:-4]) print('性别是:'+ID... 阅读全文
posted @ 2018-05-23 21:18 王滢 阅读(160) 评论(0) 推荐(0) 编辑
摘要: stuNum = '201709080008' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo = '440105199505160425' print('性别是:'+IDNo[-2]) import turtle turtle.setup(600,400,0,0... 阅读全文
posted @ 2018-05-16 20:53 王滢 阅读(197) 评论(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, ... 阅读全文
posted @ 2018-05-09 20:56 王滢 阅读(244) 评论(0) 推荐(0) 编辑
摘要: import turtle import time turtle.fillcolor('red') turtle.begin_fill() turtle.forward(100) turtle.right(144) time.sleep(1) turtle.forward(100) turtle.right(144) time.sleep(1) turtle.forward(100) turt... 阅读全文
posted @ 2018-05-02 21:38 王滢 阅读(277) 评论(0) 推荐(0) 编辑
摘要: a=int(input('摄氏温度转为华氏温度请按1\n华氏温度转为摄氏温度请按2\n')) if a=='1': c=input('请输入摄氏温度:') f=float(c)*9/5+32 print('{}摄氏温度转为华氏温度是:{}'.format(c,f)) else: f=float(in 阅读全文
posted @ 2018-04-25 21:03 王滢 阅读(262) 评论(0) 推荐(0) 编辑
摘要: a=int(input('摄氏温度转为华氏温度请按1\n华氏温度转为摄氏温度请按2\n')) if a=='1': c=input('请输入摄氏温度:') f=float(c)*9/5+32 print('{}摄氏温度转为华氏温度是:{}'.format(c,f)) else: f=float(in 阅读全文
posted @ 2018-04-25 20:40 王滢 阅读(161) 评论(0) 推荐(0) 编辑