2018年6月20日

摘要: bigFile = open('big.txt',mode='r',encoding='utf-8') bigText = bigFile.read() bigFile.close() print(bigText) replaceList=[',','.',"'",'\n'] for c in replaceList: bigText = bigText.replace(c,'') ... 阅读全文
posted @ 2018-06-20 20:39 陆梓曦 阅读(120) 评论(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) hanoi(4,'A','B','C') 阅读全文
posted @ 2018-06-13 20:56 陆梓曦 阅读(119) 评论(0) 推荐(0) 编辑

2018年6月6日

摘要: l = ['Micheal','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Micheal','Bob','Tarcy') scores = [95,75,85] d = {'Micheal':95,'Bob':75,'Tracy':85 阅读全文
posted @ 2018-06-06 23:00 陆梓曦 阅读(154) 评论(0) 推荐(0) 编辑

2018年5月30日

摘要: fr = open('letter.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('letter.txt',mod... 阅读全文
posted @ 2018-05-30 21:17 陆梓曦 阅读(88) 评论(0) 推荐(0) 编辑

2018年5月23日

摘要: id = '440105199805230056' 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): ... 阅读全文
posted @ 2018-05-23 20:44 陆梓曦 阅读(94) 评论(0) 推荐(0) 编辑

2018年5月16日

摘要: import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.pencolor('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() tur 阅读全文
posted @ 2018-05-16 20:56 陆梓曦 阅读(109) 评论(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(50... 阅读全文
posted @ 2018-05-09 20:36 陆梓曦 阅读(163) 评论(0) 推荐(0) 编辑

2018年5月2日

摘要: myNumber=24 while True: guess=int(input('请猜一个数字')) if guess > myNumber: print('猜的数字大了') elif guess < myNumber: print('猜的数字小了') else:8 print('恭喜你猜对了') 阅读全文
posted @ 2018-05-02 20:31 陆梓曦 阅读(151) 评论(0) 推荐(0) 编辑

2018年4月18日

摘要: a=input('请输入第一个数字') b=input('请输入第二个数字') sum1=int(a)+int(b) print('两个数之和{}'.format(sum1)) a=input('请输入一个摄氏度') sum2=int(a)*9/5+32 print('转换的华氏度为{}'.format(sum2)) 阅读全文
posted @ 2018-04-18 21:46 陆梓曦 阅读(111) 评论(0) 推荐(0) 编辑
摘要: name1=input('请输入一个名字:') vehicle=input('请输入一种交通工具:') name2=input('请再输入一个名字:') print('{}被{}撞倒昏迷了,{}连忙把他送到医院'.format(name1,vehicle,name2)) 阅读全文
posted @ 2018-04-18 21:08 陆梓曦 阅读(118) 评论(0) 推荐(0) 编辑

导航