摘要: def hanoi(n,a,b,c): if n==1: print(n,a+'->'+c) else: hanoi(n-1,a,c,b) print(n,a+'->'+c) hanoi(n-1,b,a,c) hanoi(6,'A','B','C') 阅读全文
posted @ 2018-06-13 20:22 钟永鑫 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 描述:1,列表可以包括任何数据类型 可以排序 随意组合 2,元组就是将各个数据的值与数据一起分组 3,字典就是能查找各个数据 4,集合就是将各个数据集合成一组 阅读全文
posted @ 2018-06-06 21:27 钟永鑫 阅读(229) 评论(0) 推荐(0) 编辑
摘要: fr = open('jinwanjiudian.txt',mode='r',encoding='utf-8') plaincode = fr.read() print('mingwen:' + plaincode) print('miwen:',end='') for c in plaincode: print(chr(ord(c)+3),end='') fr = op... 阅读全文
posted @ 2018-05-30 20:34 钟永鑫 阅读(90) 评论(0) 推荐(0) 编辑
摘要: id = '441621199811026414' area = id[0:6] birthday = id[6:14] sex = id[-2] print(area,birthday,sex) if (int(sex) % 2 == 0): print('girl') else: print('boy') for i in range(12): print(... 阅读全文
posted @ 2018-05-23 21:09 钟永鑫 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 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 dra... 阅读全文
posted @ 2018-05-16 21:36 钟永鑫 阅读(135) 评论(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-09 20:03 钟永鑫 阅读(147) 评论(0) 推荐(0) 编辑
摘要: import turtle # 设置初始位置 turtle.penup() turtle.left(90) turtle.fd(200) turtle.pendown() turtle.right(90) # 花蕊 turtle.fillcolor("red") turtle.begin_fill() turtle.circle(10, 180) turtle.circle(25, ... 阅读全文
posted @ 2018-05-09 19:57 钟永鑫 阅读(148) 评论(0) 推荐(0) 编辑
摘要: while True: a = input('摄氏转华氏按1 华氏转摄氏按2') if a == '1': #输入 c = input('请输入摄氏温度:') #计算 f = float(c)*9/5+32 #输出 print('{}摄氏度转华氏度为{}' .format(c,f)) e... 阅读全文
posted @ 2018-04-25 20:55 钟永鑫 阅读(111) 评论(0) 推荐(0) 编辑
摘要: a=input('输入一个数字') b=input('再输入一个数字') sum2=int(a)+int(b) print('两数之和:{}'.format(sum2)) a=input('输入摄氏度') sum2=int(a)*9/5+32 print('华氏温度:{}'.format(sum2)) 阅读全文
posted @ 2018-04-25 20:37 钟永鑫 阅读(90) 评论(0) 推荐(0) 编辑