Commit 07ce2ff4 by BellCodeEditor

save project

parent 4cebdb3d
import time
start_time = time.time()
print("开始时间为:",start_time)
for a in range(0,1001):
for b in range(0,1001):
for c in range(0,1001):
if a**2 + b**2 == c**2 and a+b+c == 1000:
print("a,b,c的值分别为:",a,b,c)
end_time = time.time()
print("结束的时间为:",end_time)
result = end_time - start_time
print("总共耗时:",result)
\ No newline at end of file
import turtle as t
t.pensize(8)
t.hideturtle()
# 猫脸外圈蓝色
t.fillcolor('#00A1E8')
t.begin_fill()
t.circle(120)
t.end_fill()
# 猫脸内圈白色
t.pensize(3)
t.fillcolor('white')
t.begin_fill()
t.circle(100)
t.end_fill()
# 鼻子
t.penup()
t.home()
t.goto(0, 134)
t.pendown()
t.pensize(4)
t.fillcolor("#EA0014")
t.begin_fill()
t.circle(18)
t.end_fill()
# 鼻尖
t.penup()
t.goto(7, 155)
t.pensize(2)
t.color('white', 'white')
t.pendown()
t.begin_fill()
t.circle(4)
t.end_fill()
# 左眼
t.penup()
t.goto(-30, 160)
t.pensize(4)
t.pendown()
t.color('black', 'white')
t.begin_fill()
a = 0.4
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a = a + 0.08
t.left(3) # 向左转3度
t.forward(a) # 向前走a的步长
else:
a = a - 0.08
t.left(3)
t.forward(a)
t.end_fill()
# 右眼
t.penup()
t.goto(30, 160)
t.pensize(4)
t.pendown()
t.color('black', 'white')
t.begin_fill()
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a = a + 0.08
t.left(3) # 向左转3度
t.forward(a) # 向前走a的步长
else:
a = a - 0.08
t.left(3)
t.forward(a)
t.end_fill()
# 左眼内部
t.penup()
t.goto(-38, 190)
t.pensize(8)
t.pendown()
t.right(-30)
t.forward(15)
t.right(70)
t.forward(15)
# 右眼内部
t.penup()
t.goto(15, 185)
t.pensize(4)
t.pendown()
t.color('black', 'black')
t.begin_fill()
t.circle(13)
t.end_fill()
# 右眼内部白色圆点
t.penup()
t.goto(13, 190)
t.pensize(2)
t.pendown()
t.color('white', 'white')
t.begin_fill()
t.circle(5)
t.end_fill()
# 鼻子下面的黑色竖线
t.penup()
t.home()
t.goto(0, 134)
t.pensize(4)
t.pencolor('black')
t.pendown()
t.right(90)
t.forward(40)
# 右边的胡子(第1根)
t.penup()
t.home()
t.goto(0, 124)
t.pensize(3)
t.pencolor('black')
t.pendown()
t.left(10)
t.forward(80)
# 右边的胡子(第2根)
t.penup()
t.home()
t.goto(0, 114)
t.pensize(3)
t.pencolor('black')
t.pendown()
t.left(6)
t.forward(80)
# 右边的胡子(第3根)
t.penup()
t.home()
t.goto(0, 104)
t.pensize(3)
t.pencolor('black')
t.pendown()
t.left(0)
t.forward(80)
# 左边的胡子(第1根)
t.penup()
t.home()
t.goto(0, 124)
t.pensize(3)
t.pencolor('black')
t.pendown()
t.left(170)
t.forward(80)
# 左边的胡子(第2根)
t.penup()
t.home()
t.goto(0, 114)
t.pensize(3)
t.pencolor('black')
t.pendown()
t.left(174)
t.forward(80)
# 左边的胡子(第3根)
t.penup()
t.home()
t.goto(0, 104)
t.pensize(3)
t.pencolor('black')
t.pendown()
t.left(180)
t.forward(80)
# 嘴巴(下边沿圆弧和颜色填充)
t.penup()
t.goto(-70, 70)
t.pendown()
t.color('black', 'red')
t.pensize(6)
t.setheading(-60)
t.begin_fill()
t.circle(80, 40)
t.circle(80, 80)
t.end_fill()
# 嘴巴(上边沿的横线)
t.penup()
t.home()
t.goto(-80, 70)
t.pendown()
t.forward(160)
# 舌头
t.penup()
t.home()
t.goto(-50, 50)
t.pendown()
t.pensize(1)
t.fillcolor("#eb6e1a")
t.setheading(40)
t.begin_fill()
t.circle(-40, 40)
t.circle(-40, 40)
t.setheading(40)
t.circle(-40, 40)
t.circle(-40, 40)
t.setheading(220)
t.circle(-80, 40)
t.circle(-80, 40)
t.end_fill()
# 领带
t.penup()
t.goto(-70, 12)
t.pensize(14)
t.pendown()
t.color('red')
t.seth(-20)
t.circle(200, 30)
t.circle(200, 10)
t.penup()
t.goto(0, -46)
t.pensize(3)
t.pendown()
t.color('black', 'yellow')
t.begin_fill()
t.circle(25)
t.end_fill()
t.penup()
t.goto(-5,-40)
t.pensize(2)
t.pendown()
t.color('black', '#79675d')
t.begin_fill()
t.circle(5)
t.end_fill()
t.pensize(3)
t.right(115)
t.forward(7)
t.done()
\ No newline at end of file
import time
import turtle
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment