摘要: #1. bigFile = open('big.txt',mode='r',encoding='utf-8') bigText=bigFile.read() bigFile.close() print(bigText) #2. replaceList=[',','.',"'",'\n'] for c in replaceList: bigText=bigText.replace(c,'... 阅读全文
posted @ 2018-06-11 17:50 qwertyuiopasdf 阅读(572) 评论(0) 推荐(0) 编辑
摘要: l=[['Apple','Google','Microsoft'],\ ['Java','Python','Ruby','PHP'],\ ['Adam','Bart','Lisa']\ ] names=['Michael','Bob','Tracy'] print(names[1]) scores=[95,75,85] d={'Michael':95,'Bob 阅读全文
posted @ 2018-06-04 16:40 qwertyuiopasdf 阅读(201) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.speed(10) colors=['red','purple','blue','green','yellow','orange'] for i in range(200): turtle.pencolor(colors[i%6]) turtle.forward(i) turtle.left(59) turtle.done()... 阅读全文
posted @ 2018-06-04 15:47 qwertyuiopasdf 阅读(717) 评论(0) 推荐(0) 编辑
摘要: name1 = 'Michael' name2 = 'Bob' classmates = ['Michael','Bob','Tracy',12] classmates.append('Rose') classmates.insert(1,'Jack') classmates.pop() classmates.pop(4) classmates[0] = 'Rose' print(len(cl... 阅读全文
posted @ 2018-05-28 16:57 qwertyuiopasdf 阅读(412) 评论(0) 推荐(0) 编辑
摘要: fr = open('plainText.txt',mode='r',encoding='utf-8') plainText = fr.read() print('明文:'+plainText) print('密文:',end='') fw = open('cipherText.txt',mode='a',encoding='utf-8') for c in plainText : ... 阅读全文
posted @ 2018-05-28 16:13 qwertyuiopasdf 阅读(407) 评论(0) 推荐(0) 编辑
摘要: plainText = input('message:') for d in plainText: print(chr(ord(d)+4),end='') message:tonight xsrmklx Process finished with exit code 0 阅读全文
posted @ 2018-05-21 17:09 qwertyuiopasdf 阅读(567) 评论(0) 推荐(0) 编辑
摘要: stuNum='44010505103547' print('省市区编号是:'+stuNum[0:6]) print('生日是:'+stuNum[6:10]) print('性别是:'+stuNum[12]) 省市区编号是:440105 生日是:0510 性别是:4 Process finished with exit code 0 阅读全文
posted @ 2018-05-21 16:52 qwertyuiopasdf 阅读(86) 评论(0) 推荐(0) 编辑
摘要: stuNum='201709080044' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[10:12]) 年级是:2017 专业编号是:09080 序号是:44 Process finished with exit code 0 阅读全文
posted @ 2018-05-21 16:40 qwertyuiopasdf 阅读(403) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.setup(500,300,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.pemup() turtle 阅读全文
posted @ 2018-05-14 18:00 qwertyuiopasdf 阅读(555) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.bgcolor('red') turtle.color("yellow") turtle.fillcolor("yellow") turtle.begin_fill() for i in range(5): turtle.forward(100) turtl 阅读全文
posted @ 2018-05-14 16:28 qwertyuiopasdf 阅读(235) 评论(0) 推荐(0) 编辑