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 21:54 庞伟豪 阅读(253) 评论(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.tx... 阅读全文
posted @ 2018-05-30 20:45 庞伟豪 阅读(192) 评论(0) 推荐(0) 编辑

2018年5月9日

摘要: import turtle turtle.setup(800,400,0,0) turtle.bgcolor('white') turtle.color("yellow") turtle.fillcolor("red") turtle.begin_fill() for i in range(5): turtle.forward(50) turtle.right(144) ... 阅读全文
posted @ 2018-05-09 20:16 庞伟豪 阅读(184) 评论(0) 推荐(0) 编辑

2018年5月2日

摘要: 价格 = 3 while True: guess = int(input()) if guess > 价格: print('高了') elif guess < 价格: print('低了') else: print('bingo') break 阅读全文
posted @ 2018-05-02 20:30 庞伟豪 阅读(228) 评论(0) 推荐(0) 编辑

2018年4月25日

摘要: a = int(input('摄氏度转换为华氏温度请按 1\n华氏温度转化为摄氏度请按 2\n')) if a=='1': c = float(input('请输入摄氏温度: ')) f = c*9/5+32 print('摄氏{:,2f}的华氏为{:.2f}'.format(c,f )) else: f = float(input('请输入华氏温度:')) ... 阅读全文
posted @ 2018-04-25 21:21 庞伟豪 阅读(252) 评论(0) 推荐(0) 编辑
 
摘要: a=input('请输入一个摄氏温度') sum2=int(a)*9/5+32 print('转换的华氏温度是:{}'.format(sum2)) 阅读全文
posted @ 2018-04-25 19:56 庞伟豪 阅读(192) 评论(0) 推荐(0) 编辑

2018年4月18日

摘要: num1 = input('输入第一个数字:') num2 = input('输入第二个数字:') sum = float(num1)+float(num2) print('{}和{}相加结果为{}'.format(num1,num2,sum)) 阅读全文
posted @ 2018-04-18 21:43 庞伟豪 阅读(155) 评论(0) 推荐(0) 编辑
 
摘要: name1 = input('请输入一个名字:') name2 = input('请输入一个名字: ') animal = input('请输入一个名字 :') print('刚按完摩的{}出门看见{},骑着{}走了。'.format(name1,name2,animal)) 阅读全文
posted @ 2018-04-18 20:32 庞伟豪 阅读(380) 评论(0) 推荐(0) 编辑