摘要: #1, riverFile = open('river.txt','r') riverTest = riverFile.read() riverFile.close() print(riverTest) #2, print(riverTest.replace(',',' ')) print( riverTest.replace("'",' ')) print(riverTest) #3, p... 阅读全文
posted @ 2018-06-20 20:39 容振韬 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-06-13 21:33 容振韬 阅读(118) 评论(0) 推荐(0) 编辑
摘要: l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [85,65,55] d = {'Michael':85,'Bob':65,'Tracy':55 阅读全文
posted @ 2018-06-06 21:24 容振韬 阅读(253) 评论(0) 推荐(0) 编辑
摘要: id = '511303199807040028'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')p 阅读全文
posted @ 2018-05-30 21:11 容振韬 阅读(107) 评论(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 阅读全文
posted @ 2018-05-16 20:39 容振韬 阅读(165) 评论(1) 推荐(0) 编辑
摘要: import turtle turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) tu 阅读全文
posted @ 2018-05-09 20:36 容振韬 阅读(182) 评论(0) 推荐(0) 编辑
摘要: number = 9 while True: guess = int(input('请猜一个数字\n')) if guess > number: input('猜的数字大了') elif guess < number: input('猜的数字小了') else: print('猜对了') break 阅读全文
posted @ 2018-05-02 20:58 容振韬 阅读(113) 评论(0) 推荐(0) 编辑
摘要: a=input('请输入华氏温度') sum2=int(a)*5/9-32 print('转换的摄氏温度是;{}'.format(sum2)) a=input('请输入摄氏温度') sum2=int(a)*5/9+32 print('转换的华氏温度是;{}'.format(sum2)) 阅读全文
posted @ 2018-04-25 20:32 容振韬 阅读(107) 评论(0) 推荐(0) 编辑
摘要: name1 = input('请输入一个名字:') name2 = input('再输入一个名字:') car = input('请输入一种车子:') print('练完铁头功的{}刚下山,就被{}开着带有电磁盘的{}吸走了'.format(name1,name2,car)) 阅读全文
posted @ 2018-04-18 21:20 容振韬 阅读(71) 评论(0) 推荐(0) 编辑