摘要: #1. SummertimeSadnessFile = open('SummertimeSadness.txt',mode="r",encoding='utf-8') SummertimeSadnessText = SummertimeSadnessFile.read() SummertimeSadnessFile.close() print(SummertimeSadnessText) #2... 阅读全文
posted @ 2018-06-20 21:28 陈思诺 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 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(9,'A','B','C') 复制代码 阅读全文
posted @ 2018-06-13 21:45 陈思诺 阅读(89) 评论(0) 推荐(0) 编辑
摘要: l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [95,75,85] d = {'Michael':95,'Bob':75,'Tracy':85 阅读全文
posted @ 2018-06-06 21:33 陈思诺 阅读(134) 评论(0) 推荐(0) 编辑
摘要: id = '4401051999805230066' area = id[0:6] birthday = id[6:14] sex = id[-2] print(area, birthday, sex) if (int(sex) % 2 == 0): print('girl') else: prin 阅读全文
posted @ 2018-05-23 20:25 陈思诺 阅读(64) 评论(0) 推荐(0) 编辑
摘要: stuNum = '201709080029' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo= '430721199908140021' print('省市是:'+IDNo[0 阅读全文
posted @ 2018-05-16 21:50 陈思诺 阅读(104) 评论(0) 推荐(0) 编辑