摘要: #1. loveFile = open('love.txt',mode='r',encoding='utf-8') loveText = loveFile.read() loveFile.close() print(loveText) #2. replaceList = [',','.',"'",'\n'] for c in replaceList: loveTxt = loveTex... 阅读全文
posted @ 2018-06-11 17:11 Gagaying 阅读(164) 评论(0) 推荐(0) 编辑
摘要: att = {'name': '201709080017梁嘉莹','LateTime':0,'onTime':6,'workTime':7} print(att['workTime']) import turtle turtle.speed(10) colors =['red','#FF82AB','#FFA07A','#FFB5C5','#FF6A6A','#CDC0B0','#7... 阅读全文
posted @ 2018-06-04 16:18 Gagaying 阅读(121) 评论(0) 推荐(0) 编辑
摘要: name1 = 'gaga' name2 = 'katherine' classmates = ['gaga','katherine','lily','luckly'] classmates.append('coco') classmates.insert(1,'cole') classmates.pop() classmates.pop(4) classmates[0] = 'ji... 阅读全文
posted @ 2018-05-28 16:16 Gagaying 阅读(122) 评论(0) 推荐(0) 编辑
摘要: stuNum='201709080017' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) stuNum='440682199901085049' print('广东省:'+stuNum[0:4]) print('佛山市:'+stuNum[4:6]) print('生日:... 阅读全文
posted @ 2018-05-21 15:52 Gagaying 阅读(162) 评论(0) 推荐(0) 编辑
摘要: import turtle while True: turtle.color("blue") turtle.bgcolor('red') turtle.forward(100) turtle.right(132) if abs(turtle.pos())<1: break import turtle turtle.setup(600... 阅读全文
posted @ 2018-05-14 15:41 Gagaying 阅读(162) 评论(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, 110) turtle.lef... 阅读全文
posted @ 2018-05-07 16:45 Gagaying 阅读(114) 评论(0) 推荐(0) 编辑
摘要: myNum = 9 print('猜数字游戏\n') while True: guess = int(input('请猜一个数:')) if guess > myNum: print('猜大了') elif guess >> import turtle >>> turtle.circle(50) >>> turtle.circle(100) >>>... 阅读全文
posted @ 2018-04-28 15:55 Gagaying 阅读(141) 评论(0) 推荐(0) 编辑
摘要: while True: a=input('摄氏温度转化为华氏温度请按1\n华氏温度转化为摄氏温度请按2\n') if a=='1': celsius = float(input('输入摄氏温度:')) fahrenheit=(celsius*9/5)+32 #f=c*9/5+32 print('{: 阅读全文
posted @ 2018-04-23 16:49 Gagaying 阅读(163) 评论(0) 推荐(0) 编辑
摘要: n1=input('请输入第一个数:') n2=input('请输入第二个数:') sum2=int(n1)+int(n2) print('两个数的和是:{}'.format(sum2)) a=input('请输入一个摄氏温度:') sum2=int(a)*9/5+32 print('转换的华氏温度是:{}'.format(sum2)) 阅读全文
posted @ 2018-04-22 20:26 Gagaying 阅读(107) 评论(0) 推荐(0) 编辑
摘要: >>> name1=input('请输入一个名字:') >>> name2=input('再输入一个名字:') >>> vehicle=input('请输入一种工具:') >>> print('刚装修完的{}走在路上时看到{}正在被人抢劫,马上拿起手上的{}走上去把那个人揍了一顿'.format(name1,name2,vehicle)) >>> input('press any key') ... 阅读全文
posted @ 2018-04-16 16:00 Gagaying 阅读(111) 评论(0) 推荐(0) 编辑