Paris-

导航

2018年6月5日 #

列表的应用

摘要: import turtle turtle.speed(10) colors=['red','purple','blue','green','yellow','orange','black','gold','brown',] for i in range(200): turtle.pencolor(colors[i%9]) turtle.forward(i) turtle... 阅读全文

posted @ 2018-06-05 23:58 Paris- 阅读(114) 评论(0) 推荐(0) 编辑

2018年5月28日 #

文件操作

摘要: fr = open('plainText.txt',mode='r',encoding='utf-8') plainText = fr.read() print('明文:'+plainText) print('密文:',end='') fw = open('cipherText.txt',mode= 阅读全文

posted @ 2018-05-28 16:14 Paris- 阅读(108) 评论(0) 推荐(0) 编辑

2018年5月22日 #

字符串及其操作,字符的Unicode编码

摘要: plainText=input('message:') for c in plainText: print(chr(ord(c)-3),end='') plainText=input('message:') for c in plainText: print(chr(ord(c)+3),end='') for i in range(12): pri... 阅读全文

posted @ 2018-05-22 12:10 Paris- 阅读(268) 评论(0) 推荐(0) 编辑

2018年5月14日 #

while循环与 for循环

摘要: import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle.goto(x,y) turtle.pendown() def d... 阅读全文

posted @ 2018-05-14 15:56 Paris- 阅读(146) 评论(0) 推荐(0) 编辑

2018年5月7日 #

五角星

摘要: 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(200) turtle.right(144) tu... 阅读全文

posted @ 2018-05-07 17:02 Paris- 阅读(143) 评论(0) 推荐(0) 编辑

2018年4月28日 #

猜数字

摘要: 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. >>> import turtle >>> turtle.circle(50) ... 阅读全文

posted @ 2018-04-28 16:56 Paris- 阅读(187) 评论(0) 推荐(0) 编辑

2018年4月23日 #

条件语句,while循环语句:完整的温度转换程序

摘要: while True: a=input('1:摄氏转华氏\n2:华氏转摄氏\n3:退出\n') if a =='1': celsius=float(input('输入摄氏温度:')) fahrenheit=(celsius*9/5)+32 print('{:.2f}摄氏温度转为华氏温度为{:.2f} 阅读全文

posted @ 2018-04-23 17:06 Paris- 阅读(178) 评论(0) 推荐(0) 编辑

理解数据类型与数学运算

摘要: celsius=float(input('输入摄氏温度:')) fahrenheit=(celsius*9/5)+32 #f=c*9/5+32 print('{:.2f}摄氏温度转为华氏温度为{:.2f}'.format(celsius,fahrenheit)) f=float(input('请输入华氏摄氏度:')) c=5/9*(f-32) print('{:.2f}华氏温度转换... 阅读全文

posted @ 2018-04-23 16:04 Paris- 阅读(158) 评论(0) 推荐(0) 编辑

2018年4月16日 #

Mad libs

摘要: 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 infor 阅读全文

posted @ 2018-04-16 17:08 Paris- 阅读(125) 评论(0) 推荐(0) 编辑