2018年4月13日

花朵

摘要: import turtle import math def p_line(t, n, length, angle): """Draws n line segments.""" for i in range(n): t.fd(length) t.lt(angle) def polygon(t, n, leng... 阅读全文

posted @ 2018-04-13 19:29 hbuzhangshuning 阅读(144) 评论(0) 推荐(0) 编辑

2018年4月4日

3.12DAYUP

摘要: def dayUP(df): dayup=1.0 for i in range(365): if i % 7 not in [6,5,0]: dayup=dayup*(1+df) return dayup dayfactor=0.001 a=0 while dayfactor<=0.010: a=dayUP(dayfacto... 阅读全文

posted @ 2018-04-04 20:21 hbuzhangshuning 阅读(113) 评论(0) 推荐(0) 编辑

快乐数字

摘要: num=eval(input()) while num!=1: num=pow((num//100),2)+pow((num%100)//10,2)+pow((num%10),2) print("happy") else: print("输入格式错误") 阅读全文

posted @ 2018-04-04 19:25 hbuzhangshuning 阅读(260) 评论(0) 推荐(0) 编辑

2的N次

摘要: import math n=eval(input()) a=math.pow(2,n) print(a) 阅读全文

posted @ 2018-04-04 19:16 hbuzhangshuning 阅读(126) 评论(0) 推荐(0) 编辑

2018年3月28日

2的N次

摘要: pow(2,5) 2**5 阅读全文

posted @ 2018-03-28 20:24 hbuzhangshuning 阅读(83) 评论(0) 推荐(0) 编辑

太极

摘要: import turtle import time import random rand1=random.randint(1,200) turtle.fillcolor("black") turtle.begin_fill() turtle.circle(rand1,180) turtle.end_fill () turtle.pencolor("white") turtle.goto(0,0)... 阅读全文

posted @ 2018-03-28 20:20 hbuzhangshuning 阅读(107) 评论(0) 推荐(0) 编辑

第一次作业

摘要: import turtle for i in range(4): turtle.fd(50) turtle.penup() turtle.fd(20) turtle.left(90) turtle.fd(20) turtle.pendown() turtle.fd(50) turtle.hideturtle() import turtl... 阅读全文

posted @ 2018-03-28 19:58 hbuzhangshuning 阅读(98) 评论(0) 推荐(0) 编辑

无角正方形

摘要: import turtle for i in range(4): turtle.fd(50) turtle.penup() turtle.fd(20) turtle.left(90) turtle.fd(20) turtle.pendown() turtle.fd(50) turtle.hideturtle() 阅读全文

posted @ 2018-03-28 19:50 hbuzhangshuning 阅读(374) 评论(0) 推荐(0) 编辑

叠加等边三角形

摘要: import turtle turtle.fd(100) turtle.left(120) turtle.fd(100) turtle.left(120) turtle.fd(50) turtle.left(120) turtle.fd(50) turtle.right(120) turtle.fd(50) turtle.right(120) turtle.fd(50) turtle.left(... 阅读全文

posted @ 2018-03-28 19:49 hbuzhangshuning 阅读(157) 评论(0) 推荐(0) 编辑

蟒蛇

摘要: import turtle turtle.penup() turtle.fd(-200) turtle.pendown() turtle.pensize(30) turtle.pencolor("yellow") turtle.seth(-40) for i in range(4): turtle.circle(40,80) turtle.circle(-40,80) turtl... 阅读全文

posted @ 2018-03-28 19:47 hbuzhangshuning 阅读(101) 评论(0) 推荐(0) 编辑

导航