2018年6月20日

摘要: #1, FFile = open('F.txt','r') FTest = FFile.read() FFile.close() print(FTest) #2, print(FTest.replace(',',' ')) print(FTest.replace("'",' ')) print(FT 阅读全文
posted @ 2018-06-20 22:38 傅忻 阅读(185) 评论(0) 推荐(0) 编辑

2018年6月13日

摘要: 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(7,'A','B','C') 阅读全文
posted @ 2018-06-13 21:19 傅忻 阅读(156) 评论(0) 推荐(0) 编辑

2018年6月6日

摘要: l = ['Lucy','Abb','Lily'] l.append('Abb') l.pop() print(1) t = ('Lucy','Abb','Lily') scores = [60,78,90] d = {'Lucy':60,'Abb':78,'Lily':90} d['Abb'] = 阅读全文
posted @ 2018-06-06 21:32 傅忻 阅读(152) 评论(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='') import turtle colors=['ye... 阅读全文
posted @ 2018-05-30 21:23 傅忻 阅读(205) 评论(0) 推荐(0) 编辑

2018年5月23日

摘要: stuNum = '201709090040' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo= '441424199809226968' print('省市是:'+IDNo[0:2]) print('生日是:'+IDNo[-8:-4]) print('性别是:'+IDNo... 阅读全文
posted @ 2018-05-23 21:09 傅忻 阅读(205) 评论(0) 推荐(0) 编辑

2018年5月16日

摘要: stuNum = '201709090040' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo = '440105199505160425' print('性别是:'+IDNo[-2]) import turtle turtle.setup(600,400,0,0... 阅读全文
posted @ 2018-05-16 20:35 傅忻 阅读(213) 评论(0) 推荐(0) 编辑

2018年5月9日

摘要: import turtle turtle.bgcolor('red') turtle.pencolor('yellow') turtle.fillcolor('yellow') turtle.begin_fill() for i in range(5): turtle.forward(100) tu 阅读全文
posted @ 2018-05-09 20:56 傅忻 阅读(259) 评论(0) 推荐(0) 编辑

2018年5月2日

摘要: myNumber = 18 while True: guess = int(input('请输入一个数字:')) if guess > myNumber: print('输入的数字过大:') elif guess >> import turtle >>> turtle.circle >>> turtle.circle(120) >>> turtle.c... 阅读全文
posted @ 2018-05-02 21:34 傅忻 阅读(359) 评论(0) 推荐(0) 编辑

2018年4月25日

摘要: while True: a = int(input('摄氏转华氏请按 1\n华氏转摄氏请按 2\n退出请按 3\n')) if a==1: c = float(input('请输入摄氏温度:')) f = c*9/5+32 print('摄氏{:.2f}的华氏为{:.2f}\n'.format(c, 阅读全文
posted @ 2018-04-25 21:40 傅忻 阅读(227) 评论(0) 推荐(0) 编辑

2018年4月22日

摘要: 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-22 19:13 傅忻 阅读(211) 评论(0) 推荐(0) 编辑