摘要: #1. jianFile = open('jian.txt',mode='r',encoding='utf-8') jianText = jianFile.read() jianFile.close() print(jianText) #2. replaceList = [',',"'",'-',' 阅读全文
posted @ 2018-06-11 16:50 李玮健 阅读(133) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.speed(10) colors = ['red','purple','blue','green','yellow'] for i in range(200): turtle.pencolor(colors[i%5]) turtle.forward(i) t 阅读全文
posted @ 2018-06-04 15:35 李玮健 阅读(122) 评论(0) 推荐(0) 编辑
摘要: fw = open('plainText.txt',mode='w',encoding='utf-8') for c in plainText: print(chr(ord(c)+3),end='') fw.write(chr(ord(c)+3)) name1 = 'Peter' name2 = 'Kate' people = ['Peter','Kate','Lisa',... 阅读全文
posted @ 2018-05-28 16:24 李玮健 阅读(115) 评论(0) 推荐(0) 编辑
摘要: # print(ord('a')) # print(chr(97)) for i in range(12): print(9800+i,chr(9800+i)) stuNum = '201709090065' print('年级是:'+stuNum[0:4]) print('专业编号是: '+stuNum[4:9]) print('序号是: '+stuNum[-3:]) s... 阅读全文
posted @ 2018-05-21 15:56 李玮健 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-05-14 16:04 李玮健 阅读(107) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.... 阅读全文
posted @ 2018-05-07 16:46 李玮健 阅读(340) 评论(0) 推荐(0) 编辑
摘要: myNum = 10 print('猜数字游戏\n') while True: guess=int(input('请输入一个数,大于1小于20:')) if guess > myNum: print('猜大了') elif guess < myNum: print('猜小了') else: print('恭喜你,猜... 阅读全文
posted @ 2018-05-07 14:37 李玮健 阅读(99) 评论(0) 推荐(0) 编辑
摘要: while True: a = input('1:摄氏转华氏\n2: 华氏转摄氏\n3: 退出\n') if a == '1': celsius = float(input('输入摄氏温度:')) fahrenheit = (celsius*9/5)+32 print('{:.2f}摄氏温度转为华氏 阅读全文
posted @ 2018-04-23 16:50 李玮健 阅读(310) 评论(0) 推荐(0) 编辑
摘要: >>> n1=input('请输入第一个数:') 请输入第一个数:6 >>> n2=input('请输入第二个数:') 请输入第二个数:9 >>> sum2=int(n1)+int(n2) >>> print('两个数的和是:{}'.format(sum2)) 两个数的和是:15 >>> f=input('请输入华氏温度:') 请输入华氏温度:90 >>> c=5/9*(float(f)... 阅读全文
posted @ 2018-04-23 15:15 李玮健 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> name1=input('请输入一个名字:') 请输入一个名字:贱贱 >>... 阅读全文
posted @ 2018-04-16 15:59 李玮健 阅读(178) 评论(0) 推荐(0) 编辑