五角星

摘要: import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle.goto(x,y) turtle.pendown() def draw... 阅读全文
posted @ 2018-05-16 20:51 八达岭 阅读(183) 评论(0) 推荐(0)

循环星星

摘要: import turtle turtle.pencolor('red') turtle.fillcolor('yellow') turtle.begin_fill() while True: turtle.forward(100) turtle.right(25) if(abs(turtle.pos()))<1: break turtle.end_f... 阅读全文
posted @ 2018-05-09 21:40 八达岭 阅读(120) 评论(0) 推荐(0)

五角星

摘要: import turtle turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right... 阅读全文
posted @ 2018-05-09 21:22 八达岭 阅读(103) 评论(0) 推荐(0)

星星

摘要: import turtle turtle.bgcolor('yellow') turtle.pencolor('green') turtle.fillcolor('green') turtle.begin_fill() for i in range(5): turtle.forward(100) turtle.right(144) turtle.end_fill() tu... 阅读全文
posted @ 2018-05-09 21:12 八达岭 阅读(101) 评论(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... 阅读全文
posted @ 2018-05-09 20:58 八达岭 阅读(154) 评论(0) 推荐(0)

数字游戏

摘要: myNumber = 8while True: guess = int(input()) if guess > myNumber: print('>') elif guess >> >>> import turtle >>> turtle. circle(20) >>> turtle.circle(50) >>> turtle.circle(100) >>> tu... 阅读全文
posted @ 2018-05-02 22:03 八达岭 阅读(117) 评论(0) 推荐(0)

条件语句,while循环语句:完整的温度转换程序

摘要: 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,f)) elif a... 阅读全文
posted @ 2018-04-25 21:41 八达岭 阅读(126) 评论(0) 推荐(0)

理解数据类型与数学运算:求和、温度转换

摘要: a = input('请输入一个数字') b = input('再输入一个数字') sum2 = int(a) + int(b) print('两个数的和是:{}'.format(sum2)) a = input('请输入一个温度') sum2=int(a) * 9/5 + 32 print('转换 阅读全文
posted @ 2018-04-18 21:45 八达岭 阅读(82) 评论(0) 推荐(0)

输入、输出与Mad Libs 游戏

摘要: name1=input('请输入一个名字') name2=input('请输入一种食物') print('{}吃了妖精的{}变成了猪'.format(name1,name2)) 阅读全文
posted @ 2018-04-18 20:46 八达岭 阅读(93) 评论(0) 推荐(0)