摘要: #1.salahFile = open('salah.txt',mode="r",encoding='utf-8')salahText = salahFile.read()salahFile.close()print(salahText)#2.replaceList = [',','.',"'",' 阅读全文
posted @ 2018-06-20 21:13 李凌正 阅读(87) 评论(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(7,'A','B','C') 阅读全文
posted @ 2018-06-13 21:01 李凌正 阅读(75) 评论(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}d['Bo 阅读全文
posted @ 2018-06-06 21:42 李凌正 阅读(126) 评论(0) 推荐(0) 编辑
摘要: fr = open('salah.txt', mode='r', encoding='utf-8')plaincode=fr.read()print('明文:'+plaincode)print('密文:',end='')for c in plaincode: print(chr(ord(c)+3),end='') fr = open('salah.txt',mode='r',encoding... 阅读全文
posted @ 2018-05-30 21:34 李凌正 阅读(102) 评论(0) 推荐(0) 编辑
摘要: id = '440802199707180017'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(9800+i,chr(9... 阅读全文
posted @ 2018-05-23 21:13 李凌正 阅读(160) 评论(0) 推荐(0) 编辑
摘要: stuNum = '201709080030'print('年级是:'+stuNum[0:4])print('专业编号是:'+stuNum[4:9])print('序号是:'+stuNum[-3:])IDNo= '440802199707180017'print('省市是:'+IDNo[0:2])p 阅读全文
posted @ 2018-05-23 19:58 李凌正 阅读(72) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle 阅读全文
posted @ 2018-05-16 20:13 李凌正 阅读(132) 评论(0) 推荐(0) 编辑
摘要: import turtle # 设置初始位置 turtle.penup()turtle.left(90)turtle.fd(200)turtle.pendown()turtle.right(90) # 花蕊 turtle.fillcolor("red")turtle.begin_fill()turt 阅读全文
posted @ 2018-05-09 20:51 李凌正 阅读(228) 评论(0) 推荐(0) 编辑
摘要: number = 6while True: guess = int(input('估数字啊柒头\n')) if guess > number: input('大閪咗啊柒头') elif guess < number: input('细閪咗啊柒头') else: print('估閪啱咗喔,咁犀利噶你个 阅读全文
posted @ 2018-05-02 20:31 李凌正 阅读(151) 评论(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(inpu 阅读全文
posted @ 2018-04-25 21:22 李凌正 阅读(186) 评论(0) 推荐(0) 编辑