摘要: import turtle turtle.speed(10) colors = ['red','purple','blue','green','yellow','orange'] for i in range(50): turtle.pencolor('blue') turtle.forward(i) turtle.left(59) turtle.done() ... 阅读全文
posted @ 2018-06-04 16:50 12z 阅读(101) 评论(0) 推荐(0) 编辑
摘要: fr = open ('plainText.txt',mode+'r'encoding='utf-8') plainText = fr.read() print('明文:'+plainText) prin('密文:', end='') fw = open('p.txt,mode='a', encoding='utf-8') for c in plainText: print(chr(o... 阅读全文
posted @ 2018-05-28 16:48 12z 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 凯撒密码 星座 阅读全文
posted @ 2018-05-21 16:55 12z 阅读(147) 评论(0) 推荐(0) 编辑
摘要: import turtle while True: turtle.forward(100) turtle.right(190) if abs(turtle.pos())<1: break turtle.done() import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turt... 阅读全文
posted @ 2018-05-14 16:39 12z 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 五角星 阅读全文
posted @ 2018-05-07 16:55 12z 阅读(203) 评论(0) 推荐(0) 编辑
摘要: while True: a = input('1:摄氏温度转为华氏温度请按\n2:华氏温度转为摄氏温度请按\n3:退出\n') if a =='1': c = float(input('请输入华氏温度:')) f = c*9/5+32 print('{:.2f}摄氏温度转为华氏温度为:{:.2f}\n'.format(c,f))... 阅读全文
posted @ 2018-04-28 16:40 12z 阅读(118) 评论(0) 推荐(0) 编辑
摘要: myNum=8 print('猜数字游戏/n') while True: guess=int(input('请猜一个数:')) if guess> myNum: print('猜大了') elif guess< myNum: print('猜小了') else: print('恭喜你,猜对了!') 阅读全文
posted @ 2018-04-28 16:20 12z 阅读(119) 评论(0) 推荐(0) 编辑
摘要: num1=input('请输入第一个数字:') num2=input('请输入第二个数字:') sum=float(num1)+float(num2) print('数字{}和{}相加结果为:{}'.format(num1,num2,sum)) celsius=float(input('输入摄氏温度')) fahrenheit=(celsius*1.8)+32#f=c*9/5+32 ... 阅读全文
posted @ 2018-04-23 16:58 12z 阅读(132) 评论(0) 推荐(0) 编辑
摘要: >>> name1=input('请输入一个名字') 请输入一个名字二丫 >>> name2=input('请再输入一个名字') 请再输入一个名字铁蛋 >>> vehicle=input('请输入一种物品') 请输入一种物品流口水的二哈 >>> print('{}刚准备吃蛋糕,就被{}牵着的{}给撞飞了'.format(name1,name2... 阅读全文
posted @ 2018-04-16 16:47 12z 阅读(110) 评论(0) 推荐(0) 编辑