2018年6月14日
摘要: 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(5, 'A', 'B', ' 阅读全文
posted @ 2018-06-14 17:28 周天凯 阅读(128) 评论(0) 推荐(0) 编辑
  2018年6月8日
摘要: l = ['Michael', 'Bob', 'Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael', 'Bob', 'Tracy') scores = [95, 70, 60] d = {'Michael': 95, 'Bob': 70, 阅读全文
posted @ 2018-06-08 18:28 周天凯 阅读(148) 评论(0) 推荐(0) 编辑
  2018年5月30日
摘要: fr = open('letter.txt',mode='r',encoding='utf-8') plaincode = fr.read() print('明文:'+ plaincode) print('密文',end='') for c in plaincode: print(chr(ord(c)+3),end='') turtle.speed(10) colors = ['... 阅读全文
posted @ 2018-05-30 21:20 周天凯 阅读(94) 评论(0) 推荐(0) 编辑
  2018年5月23日
摘要: id='440902199706280054' area=id[0:8] birthday=id[6:14] sex=id[-2] print(area,birthday,sex) if(int(sex) % 2 == 0): print('girl') else: print('boy') print(ord('+')) print(chr(9800)) prin... 阅读全文
posted @ 2018-05-23 20:58 周天凯 阅读(139) 评论(0) 推荐(0) 编辑
  2018年5月16日
摘要: stuNum='201709090038' print('年级:'+stuNum[0:4]) print('专业:'+stuNum[4:9]) print('序号:'+stuNum[-3:]) IDNo='440902199706280054' print('性别是:'+IDNo[-2]) print('市区是'+IDNo[0:6]) print('生日是'+IDNo[6:13]) ... 阅读全文
posted @ 2018-05-16 21:20 周天凯 阅读(143) 评论(0) 推荐(0) 编辑
  2018年5月9日
摘要: import turtle turtle. pencolor('blue') turtle. fillcolor('purple') turtle.begin_fill() while True: turtle. forward(100) turtle. right (150) if abs(turtle. position())<1: break t... 阅读全文
posted @ 2018-05-09 21:27 周天凯 阅读(160) 评论(0) 推荐(0) 编辑
摘要: mynumber=50 while True: guess=float(input('请输入一个数字')) if guess>mynumber: print('数字猜大了') elif guess<mynumber: print('数字猜小了') else: print('恭喜你猜对了') break... 阅读全文
posted @ 2018-05-09 19:12 周天凯 阅读(91) 评论(0) 推荐(0) 编辑
  2018年4月25日
摘要: c= input('请输入摄氏温度') f= float(c)*9/5+32 print('{}摄氏温度转为华氏温度{}'.format(f,c)) 阅读全文
posted @ 2018-04-25 21:36 周天凯 阅读(108) 评论(0) 推荐(0) 编辑