2018年6月20日

摘要: #1. theFile = open('the.txt',mode='r',encoding='utf-8') theText = theFile.read() # 从文件里读出全部文本,字符串 theFile.close() print(theText) #2. replaceList = [',','.',"'",'\n'] for c in replaceList: theTe... 阅读全文
posted @ 2018-06-20 21:40 AmberGCC 阅读(152) 评论(0) 推荐(0)

2018年6月13日

摘要: 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) 阅读全文
posted @ 2018-06-13 21:46 AmberGCC 阅读(121) 评论(0) 推荐(0)

2018年6月6日

摘要: l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [95,75,85] d = {'Michael':95,'Bob':75,'Tracy':85 阅读全文
posted @ 2018-06-06 21:37 AmberGCC 阅读(99) 评论(0) 推荐(0)

2018年5月30日

摘要: 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:32 AmberGCC 阅读(89) 评论(0) 推荐(0)
摘要: import turtle turtle.speed(10) colors = ['red','purple','blue','green','yellow','orange'] for i in range(100): turtle.pencolor(colors[i% 6]) turtle.fo 阅读全文
posted @ 2018-05-30 21:23 AmberGCC 阅读(76) 评论(0) 推荐(0)

2018年5月23日

摘要: id = '511303199807040028' 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(... 阅读全文
posted @ 2018-05-23 21:42 AmberGCC 阅读(87) 评论(0) 推荐(0)

2018年5月16日

摘要: stuNum = '201709080059' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo= '511303199807040028' print('省市是:'+IDNo[0 阅读全文
posted @ 2018-05-16 21:46 AmberGCC 阅读(143) 评论(0) 推荐(0)
摘要: import turtle turtle.bgcolor("red") turtle.fillcolor("yellow") turtle.color('yellow') turtle.speed(10) turtle.begin_fill() turtle.up() turtle.goto(-60 阅读全文
posted @ 2018-05-16 20:59 AmberGCC 阅读(126) 评论(0) 推荐(0)

2018年5月9日

摘要: 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, 110) turtle.left... 阅读全文
posted @ 2018-05-09 21:18 AmberGCC 阅读(165) 评论(0) 推荐(0)

2018年4月25日

摘要: a=input('请输入第一个数:') b=input('请输入第二个数:') sum2=int(a)+int(b) print('两个数的和是: {} '.format(sum2)) a=input('请输入摄氏度:') sum=int(a)*5/9+32 print('华氏温度: {} '.format(sum2)) 阅读全文
posted @ 2018-04-25 21:27 AmberGCC 阅读(75) 评论(0) 推荐(0)

导航