摘要: import turtle turtle.speed(10) colors=['red','purple','blue','green','yellow'] for i in range(200): turtle.pencolor(colors[i%5]) turtle.forward(i) tur 阅读全文
posted @ 2018-06-04 15:41 麦衍铭 阅读(99) 评论(0) 推荐(0) 编辑
摘要: fr = open('plainText.txt',mode='r',encoding='utf-8') plainText = fr.read() print(plainText) print('密文:',end='') for c in plainText: print(chr(ord(c)+3 阅读全文
posted @ 2018-05-28 16:43 麦衍铭 阅读(71) 评论(0) 推荐(0) 编辑
摘要: stuNum = '201709090072' print('年级是:'+stuNum[0:4]) print('专业编号是: '+stuNum[4:9]) print('序号是: '+stuNum[-3:]) stuNum = '440982201812111876' print('所在省市:'+stuNum[0:2]) print('所在地区:'+stuNum[2:4]) print('... 阅读全文
posted @ 2018-05-21 15:59 麦衍铭 阅读(82) 评论(0) 推荐(0) 编辑
摘要: from turtle import * fillcolor("red") begin_fill() while True: forward(200) right(144) if abs(pos()) < 1: break end_fill() 阅读全文
posted @ 2018-05-14 16:12 麦衍铭 阅读(78) 评论(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, ... 阅读全文
posted @ 2018-05-07 16:44 麦衍铭 阅读(153) 评论(0) 推荐(0) 编辑
摘要: myNum=15 print('猜字游戏练练玩\n') while True: guess=int(input('请输入一个数字 :')) if guess>myNum: print('猜大了') elif guess<myNum: print('猜小了') else: print('你终于猜对了' 阅读全文
posted @ 2018-05-05 21:47 麦衍铭 阅读(446) 评论(0) 推荐(0) 编辑
摘要: while True: a = input('1:摄氏度转华氏度\n2:华氏度转摄氏度\n3:退出\n') if a =='1': celsius=float(input('输入摄氏度:')) fahrenheit=(celsius*9/5)+32 print('{:.2f}摄氏度转化为华氏度{:.2f}'.format(celsius,fahrenh... 阅读全文
posted @ 2018-04-23 16:49 麦衍铭 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 请输入一个数字999 >>> b=input('请再输入一个数字') 请再输入一个数字666 >>> suml=int(a)+int(b) >>> print('两数之和是:{}'.format(suml)) 两数之和是:1665 >>> a=input('请输入摄氏度') 请输入摄氏度40 >>> suml=int(a)*... 阅读全文
posted @ 2018-04-22 18:06 麦衍铭 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 请输入一个名字:Old back >>> name2=input('再输入一个名字:') 再输入一个名字:Old yellow >>> vehicle=input('请输入一种车子:') 请输入一种车子:三轮 >>> print('刚刚吃完鸡的{}被拿着鸡排的{}开着少了个轮子的{}撞... 阅读全文
posted @ 2018-04-16 16:04 麦衍铭 阅读(128) 评论(0) 推荐(0) 编辑