摘要: #1. zqqFile = open('zqq.txt',mode="r",encoding='utf-8') zqqText =zqqFile.read() zqqFile.close() print(zqqText) #2. replaceList = [',','.',"'",'\n'] fo 阅读全文
posted @ 2018-06-11 16:45 Candice_Z 阅读(163) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.speed(5) colors =['#FFC0CB','#FFFF00','#B0E2FF','#00EEEE','#00CED1','#00C5CD','#00B2EE','#009ACD'] for i in range(200): turtle.pe 阅读全文
posted @ 2018-06-04 15:37 Candice_Z 阅读(72) 评论(0) 推荐(0) 编辑
摘要: fr = open('lja2.txt',mode='r',encoding='utf-8') plainText = fr.read() print('明文:'+plainText) print('密文:',end='') for c in plainText: print(chr(ord(c)+ 阅读全文
posted @ 2018-05-28 16:12 Candice_Z 阅读(80) 评论(1) 推荐(0) 编辑
摘要: for i in range(12): print(9800+i,chr(9800+i)) stuNum = '201709080045' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) stuNum = '440104199610264729' print('所在... 阅读全文
posted @ 2018-05-21 15:34 Candice_Z 阅读(87) 评论(0) 推荐(0) 编辑
摘要: import turtle while True: turtle.forward(100) turtle.right(145) if abs(turtle.pos())<1: break 阅读全文
posted @ 2018-05-14 15:17 Candice_Z 阅读(109) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolor('yellow') turtle.begin_fill() for i in range(5): turtle.forward(100) turtle.left(144) t... 阅读全文
posted @ 2018-05-14 15:09 Candice_Z 阅读(2007) 评论(0) 推荐(0) 编辑
摘要: myNum = 7 print('猜数字游戏\n') while True: guess = int(input('请猜一个数:')) if guess > myNum: print('猜大的') elif guess < myNum: print('猜小了') else: print('恭喜你,猜对了!') ... 阅读全文
posted @ 2018-05-07 15:29 Candice_Z 阅读(155) 评论(0) 推荐(0) 编辑
摘要: while True: a = input('1:摄氏温度转为华氏温度请按\n2:华氏温度转为摄氏温度请按\n3:退出\n') if a =='1': c = float(input('请输入华氏温度:')) f = c*9/5+32 print('{:.2f}摄氏温度转为华氏温度为:{:.2f}\ 阅读全文
posted @ 2018-04-30 13:29 Candice_Z 阅读(157) 评论(0) 推荐(0) 编辑
摘要: n1=input('请输入一个数字:') n2=input('请输入一个数字:') sum2=int(n1)+int(n2) print('两数之和是:{}'.format(sum2)) #摄氏℃=5/9(°F-32) #输入 f=float(input('输入摄氏温度:')) #计算 c=5/9*(f-32) #输出 print('{:.2f}华氏温度转换为摄氏温度为:{:.2f}'... 阅读全文
posted @ 2018-04-23 16:07 Candice_Z 阅读(123) 评论(0) 推荐(0) 编辑
摘要: name1=input('请输入一个名字') name2=input('请输入一个名字') vehicle=input('请输入一种动物') print('贪玩的{}牵着{}冲向{}'.format(name1,vehicle,name2)) input('press any key') 阅读全文
posted @ 2018-04-16 16:16 Candice_Z 阅读(97) 评论(0) 推荐(0) 编辑