当前位置:   article > 正文

用python画一个动漫人物,用python画动漫人物代码_python动漫人物代码

python动漫人物代码

大家好,小编来为大家解答以下问题,用python画一个动漫人物,用python画动漫人物代码,现在让我们一起来看看吧!

小猪佩奇

  1. # coding:utf-8
  2. import turtle as t
  3. t.pensize(4) # 设置画笔的大小
  4. t.colormode(255) # 设置GBK颜色范围为0-255
  5. t.color((255,155,192),"pink") # 设置画笔颜色和填充颜色(pink)
  6. t.setup(840,500) # 设置主窗口的大小为840*500
  7. t.speed(10) # 设置画笔速度为10
  8. #鼻子
  9. t.pu() # 提笔
  10. t.goto(-100,100) # 画笔前往坐标(-100,100)
  11. t.pd() # 下笔
  12. t.seth(-30) # 笔的角度为-30°
  13. t.begin_fill() # 外形填充的开始标志
  14. a=0.4
  15. for i in range(120):
  16. if 0<=i<30 or 60<=i<90:
  17. a=a+0.08
  18. t.lt(3) #向左转3度
  19. t.fd(a) #向前走a的步长
  20. else:
  21. a=a-0.08
  22. t.lt(3)
  23. t.fd(a)
  24. t.end_fill() # 依据轮廓填充
  25. t.pu() # 提笔
  26. t.seth(90) # 笔的角度为90度
  27. t.fd(25) # 向前移动25
  28. t.seth(0) # 转换画笔的角度为0
  29. t.fd(10)
  30. t.pd()
  31. t.pencolor(255,155,192) # 设置画笔颜色
  32. t.seth(10)
  33. t.begin_fill()
  34. t.circle(5) # 画一个半径为5的圆
  35. t.color(160,82,45) # 设置画笔和填充颜色
  36. t.end_fill()
  37. t.pu()
  38. t.seth(0)
  39. t.fd(20)
  40. t.pd()
  41. t.pencolor(255,155,192)
  42. t.seth(10)
  43. t.begin_fill()
  44. t.circle(5)
  45. t.color(160,82,45)
  46. t.end_fill()
  47. #头
  48. t.color((255,155,192),"pink")
  49. t.pu()
  50. t.seth(90)
  51. t.fd(41)
  52. t.seth(0)
  53. t.fd(0)
  54. t.pd()
  55. t.begin_fill()
  56. t.seth(180)
  57. t.circle(300,-30) # 顺时针画一个半径为300,圆心角为30°的园
  58. t.circle(100,-60)
  59. t.circle(80,-100)
  60. t.circle(150,-20)
  61. t.circle(60,-95)
  62. t.seth(161)
  63. t.circle(-300,15)
  64. t.pu()
  65. t.goto(-100,100)
  66. t.pd()
  67. t.seth(-30)
  68. a=0.4
  69. for i in range(60):
  70. if 0<=i<30 or 60<=i<90:
  71. a=a+0.08
  72. t.lt(3) #向左转3度
  73. t.fd(a) #向前走a的步长
  74. else:
  75. a=a-0.08
  76. t.lt(3)
  77. t.fd(a)
  78. t.end_fill()
  79. #耳朵
  80. t.color((255,155,192),"pink")
  81. t.pu()
  82. t.seth(90)
  83. t.fd(-7)
  84. t.seth(0)
  85. t.fd(70)
  86. t.pd()
  87. t.begin_fill()
  88. t.seth(100)
  89. t.circle(-50,50)
  90. t.circle(-10,120)
  91. t.circle(-50,54)
  92. t.end_fill()
  93. t.pu()
  94. t.seth(90)
  95. t.fd(-12)
  96. t.seth(0)
  97. t.fd(30)
  98. t.pd()
  99. t.begin_fill()
  100. t.seth(100)
  101. t.circle(-50,50)
  102. t.circle(-10,120)
  103. t.circle(-50,56)
  104. t.end_fill()
  105. #眼睛
  106. t.color((255,155,192),"white")
  107. t.pu()
  108. t.seth(90)
  109. t.fd(-20)
  110. t.seth(0)
  111. t.fd(-95)
  112. t.pd()
  113. t.begin_fill()
  114. t.circle(15)
  115. t.end_fill()
  116. t.color("black")
  117. t.pu()
  118. t.seth(90)
  119. t.fd(12)
  120. t.seth(0)
  121. t.fd(-3)
  122. t.pd()
  123. t.begin_fill()
  124. t.circle(3)
  125. t.end_fill()
  126. t.color((255,155,192),"white")
  127. t.pu()
  128. t.seth(90)
  129. t.fd(-25)
  130. t.seth(0)
  131. t.fd(40)
  132. t.pd()
  133. t.begin_fill()
  134. t.circle(15)
  135. t.end_fill()
  136. t.color("black")
  137. t.pu()
  138. t.seth(90)
  139. t.fd(12)
  140. t.seth(0)
  141. t.fd(-3)
  142. t.pd()
  143. t.begin_fill()
  144. t.circle(3)
  145. t.end_fill()
  146. #腮
  147. t.color((255,155,192))
  148. t.pu()
  149. t.seth(90)
  150. t.fd(-95)
  151. t.seth(0)
  152. t.fd(65)
  153. t.pd()
  154. t.begin_fill()
  155. t.circle(30)
  156. t.end_fill()
  157. #嘴
  158. t.color(239,69,19)
  159. t.pu()
  160. t.seth(90)
  161. t.fd(15)
  162. t.seth(0)
  163. t.fd(-100)
  164. t.pd()
  165. t.seth(-80)
  166. t.circle(30,40)
  167. t.circle(40,80)
  168. #身体
  169. t.color("red",(255,99,71))
  170. t.pu()
  171. t.seth(90)
  172. t.fd(-20)
  173. t.seth(0)
  174. t.fd(-78)
  175. t.pd()
  176. t.begin_fill()
  177. t.seth(-130)
  178. t.circle(100,10)
  179. t.circle(300,30)
  180. t.seth(0)
  181. t.fd(230)
  182. t.seth(90)
  183. t.circle(300,30)
  184. t.circle(100,3)
  185. t.color((255,155,192),(255,100,100))
  186. t.seth(-135)
  187. t.circle(-80,63)
  188. t.circle(-150,24)
  189. t.end_fill()
  190. #手
  191. t.color((255,155,192))
  192. t.pu()
  193. t.seth(90)
  194. t.fd(-40)
  195. t.seth(0)
  196. t.fd(-27)
  197. t.pd()
  198. t.seth(-160)
  199. t.circle(300,15)
  200. t.pu()
  201. t.seth(90)
  202. t.fd(15)
  203. t.seth(0)
  204. t.fd(0)
  205. t.pd()
  206. t.seth(-10)
  207. t.circle(-20,90)
  208. t.pu()
  209. t.seth(90)
  210. t.fd(30)
  211. t.seth(0)
  212. t.fd(237)
  213. t.pd()
  214. t.seth(-20)
  215. t.circle(-300,15)
  216. t.pu()
  217. t.seth(90)
  218. t.fd(20)
  219. t.seth(0)
  220. t.fd(0)
  221. t.pd()
  222. t.seth(-170)
  223. t.circle(20,90)
  224. #脚
  225. t.pensize(10)
  226. t.color((240,128,128))
  227. t.pu()
  228. t.seth(90)
  229. t.fd(-75)
  230. t.seth(0)
  231. t.fd(-180)
  232. t.pd()
  233. t.seth(-90)
  234. t.fd(40)
  235. t.seth(-180)
  236. t.color("black")
  237. t.pensize(15)
  238. t.fd(20)
  239. t.pensize(10)
  240. t.color((240,128,128))
  241. t.pu()
  242. t.seth(90)
  243. t.fd(40)
  244. t.seth(0)
  245. t.fd(90)
  246. t.pd()
  247. t.seth(-90)
  248. t.fd(40)
  249. t.seth(-180)
  250. t.color("black")
  251. t.pensize(15)
  252. t.fd(20)
  253. #尾巴
  254. t.pensize(4)
  255. t.color((255,155,192))
  256. t.pu()
  257. t.seth(90)
  258. t.fd(70)
  259. t.seth(0)
  260. t.fd(95)
  261. t.pd()
  262. t.seth(0)
  263. t.circle(70,20)
  264. t.circle(10,330)
  265. t.circle(70,30)

结果:
在这里插入图片描述

多来a梦

  1. # * -- utf-8 -- *
  2. # Author: Tang
  3. import turtle as t
  4. t.speed(10)
  5. t.pensize(8)
  6. t.hideturtle()
  7. t.screensize(500, 500, bg='white')
  8. # 猫脸
  9. t.fillcolor('#00A1E8')
  10. t.begin_fill()
  11. t.circle(120)
  12. t.end_fill()
  13. t.pensize(3)
  14. t.fillcolor('white')
  15. t.begin_fill()
  16. t.circle(100)
  17. t.end_fill()
  18. t.pu()
  19. t.home()
  20. t.goto(0, 134)
  21. t.pd()
  22. t.pensize(4)
  23. t.fillcolor("#EA0014")
  24. t.begin_fill()
  25. t.circle(18)
  26. t.end_fill()
  27. t.pu()
  28. t.goto(7, 155)
  29. t.pensize(2)
  30. t.color('white', 'white')
  31. t.pd()
  32. t.begin_fill()
  33. t.circle(4)
  34. t.end_fill()
  35. t.pu()
  36. t.goto(-30, 160)
  37. t.pensize(4)
  38. t.pd()
  39. t.color('black', 'white')
  40. t.begin_fill()
  41. a = 0.4
  42. for i in range(120):
  43. if 0 <= i < 30 or 60 <= i < 90:
  44. a = a+0.08
  45. t.lt(3) #向左转3度
  46. t.fd(a) #向前走a的步长
  47. else:
  48. a = a-0.08
  49. t.lt(3)
  50. t.fd(a)
  51. t.end_fill()
  52. t.pu()
  53. t.goto(30, 160)
  54. t.pensize(4)
  55. t.pd()
  56. t.color('black', 'white')
  57. t.begin_fill()
  58. for i in range(120):
  59. if 0 <= i < 30 or 60 <= i < 90:
  60. a = a+0.08
  61. t.lt(3) # 向左转3度
  62. t.fd(a) # 向前走a的步长
  63. else:
  64. a = a-0.08
  65. t.lt(3)
  66. t.fd(a)
  67. t.end_fill()
  68. t.pu()
  69. t.goto(-38,190)
  70. t.pensize(8)
  71. t.pd()
  72. t.right(-30)
  73. t.forward(15)
  74. t.right(70)
  75. t.forward(15)
  76. t.pu()
  77. t.goto(15, 185)
  78. t.pensize(4)
  79. t.pd()
  80. t.color('black', 'black')
  81. t.begin_fill()
  82. t.circle(13)
  83. t.end_fill()
  84. t.pu()
  85. t.goto(13, 190)
  86. t.pensize(2)
  87. t.pd()
  88. t.color('white', 'white')
  89. t.begin_fill()
  90. t.circle(5)
  91. t.end_fill()
  92. t.pu()
  93. t.home()
  94. t.goto(0, 134)
  95. t.pensize(4)
  96. t.pencolor('black')
  97. t.pd()
  98. t.right(90)
  99. t.forward(40)
  100. t.pu()
  101. t.home()
  102. t.goto(0, 124)
  103. t.pensize(3)
  104. t.pencolor('black')
  105. t.pd()
  106. t.left(10)
  107. t.forward(80)
  108. t.pu()
  109. t.home()
  110. t.goto(0, 114)
  111. t.pensize(3)
  112. t.pencolor('black')
  113. t.pd()
  114. t.left(6)
  115. t.forward(80)
  116. t.pu()
  117. t.home()
  118. t.goto(0,104)
  119. t.pensize(3)
  120. t.pencolor('black')
  121. t.pd()
  122. t.left(0)
  123. t.forward(80)
  124. # 左边的胡子
  125. t.pu()
  126. t.home()
  127. t.goto(0,124)
  128. t.pensize(3)
  129. t.pencolor('black')
  130. t.pd()
  131. t.left(170)
  132. t.forward(80)
  133. t.pu()
  134. t.home()
  135. t.goto(0, 114)
  136. t.pensize(3)
  137. t.pencolor('black')
  138. t.pd()
  139. t.left(174)
  140. t.forward(80)
  141. t.pu()
  142. t.home()
  143. t.goto(0, 104)
  144. t.pensize(3)
  145. t.pencolor('black')
  146. t.pd()
  147. t.left(180)
  148. t.forward(80)
  149. t.pu()
  150. t.goto(-70, 70)
  151. t.pd()
  152. t.color('black', 'red')
  153. t.pensize(6)
  154. t.seth(-60)
  155. t.begin_fill()
  156. t.circle(80,40)
  157. t.circle(80,80)
  158. t.end_fill()
  159. t.pu()
  160. t.home()
  161. t.goto(-80,70)
  162. t.pd()
  163. t.forward(160)
  164. t.pu()
  165. t.home()
  166. t.goto(-50,50)
  167. t.pd()
  168. t.pensize(1)
  169. t.fillcolor("#eb6e1a")
  170. t.seth(40)
  171. t.begin_fill()
  172. t.circle(-40, 40)
  173. t.circle(-40, 40)
  174. t.seth(40)
  175. t.circle(-40, 40)
  176. t.circle(-40, 40)
  177. t.seth(220)
  178. t.circle(-80, 40)
  179. t.circle(-80, 40)
  180. t.end_fill()
  181. # 领带
  182. t.pu()
  183. t.goto(-70, 12)
  184. t.pensize(14)
  185. t.pencolor('red')
  186. t.pd()
  187. t.seth(-20)
  188. t.circle(200, 30)
  189. t.circle(200, 10)
  190. # 铃铛
  191. t.pu()
  192. t.goto(0, -46)
  193. t.pd()
  194. t.pensize(3)
  195. t.color("black", '#f8d102')
  196. t.begin_fill()
  197. t.circle(25)
  198. t.end_fill()
  199. t.pu()
  200. t.goto(-5, -40)
  201. t.pd()
  202. t.pensize(2)
  203. t.color("black", '#79675d')
  204. t.begin_fill()
  205. t.circle(5)
  206. t.end_fill()
  207. t.pensize(3)
  208. t.right(115)
  209. t.forward(7)
  210. t.mainloop()

结果:
在这里插入图片描述

皮卡丘

  1. #!/usr/bin/env python
  2. # -*- coding:utf-8 -*-
  3. from turtle import *
  4. '''
  5. 绘制皮卡丘头部
  6. '''
  7. def face(x,y):
  8. """画脸"""
  9. begin_fill()
  10. penup()
  11. # 将海龟移动到指定的坐标
  12. goto(x, y)
  13. pendown()
  14. # 设置海龟的方向
  15. setheading(40)
  16. circle(-150, 69)
  17. fillcolor("#FBD624")
  18. # 将海龟移动到指定的坐标
  19. penup()
  20. goto(53.14, 113.29)
  21. pendown()
  22. setheading(300)
  23. circle(-150, 30)
  24. setheading(295)
  25. circle(-140, 20)
  26. print(position())
  27. forward(5)
  28. setheading(260)
  29. circle(-80, 70)
  30. print(position())
  31. penup()
  32. goto(-74.43,-79.09)
  33. pendown()
  34. penup()
  35. # 将海龟移动到指定的坐标
  36. goto(-144,103)
  37. pendown()
  38. setheading(242)
  39. circle(110, 35)
  40. right(10)
  41. forward(10)
  42. setheading(250)
  43. circle(80, 115)
  44. print(position())
  45. penup()
  46. goto(-74.43,-79.09)
  47. pendown()
  48. setheading(10)
  49. penup()
  50. goto(-144, 103)
  51. pendown()
  52. penup()
  53. goto(x, y)
  54. pendown()
  55. end_fill()
  56. # 下巴
  57. penup()
  58. goto(-50, -82.09)
  59. pendown()
  60. pencolor("#DDA120")
  61. fillcolor("#DDA120")
  62. begin_fill()
  63. setheading(-12)
  64. circle(120, 25)
  65. setheading(-145)
  66. forward(30)
  67. setheading(180)
  68. circle(-20, 20)
  69. setheading(143)
  70. forward(30)
  71. end_fill()
  72. # penup()
  73. # # 将海龟移动到指定的坐标
  74. # goto(0, 0)
  75. # pendown()
  76. def eye():
  77. """画眼睛"""
  78. # 左眼
  79. color("black","black")
  80. penup()
  81. goto(-110, 27)
  82. pendown()
  83. begin_fill()
  84. setheading(0)
  85. circle(24)
  86. end_fill()
  87. # 左眼仁
  88. color("white", "white")
  89. penup()
  90. goto(-105, 51)
  91. pendown()
  92. begin_fill()
  93. setheading(0)
  94. circle(10)
  95. end_fill()
  96. # 右眼
  97. color("black", "black")
  98. penup()
  99. goto(25, 40)
  100. pendown()
  101. begin_fill()
  102. setheading(0)
  103. circle(24)
  104. end_fill()
  105. # 右眼仁
  106. color("white", "white")
  107. penup()
  108. goto(17, 62)
  109. pendown()
  110. begin_fill()
  111. setheading(0)
  112. circle(10)
  113. end_fill()
  114. def cheek():
  115. """画脸颊"""
  116. # 右边
  117. color("#9E4406", "#FE2C21")
  118. penup()
  119. goto(-130, -50)
  120. pendown()
  121. begin_fill()
  122. setheading(0)
  123. circle(27)
  124. end_fill()
  125. # 左边
  126. color("#9E4406", "#FE2C21")
  127. penup()
  128. goto(53, -20)
  129. pendown()
  130. begin_fill()
  131. setheading(0)
  132. circle(27)
  133. end_fill()
  134. def nose():
  135. """画鼻子"""
  136. color("black", "black")
  137. penup()
  138. goto(-40, 38)
  139. pendown()
  140. begin_fill()
  141. circle(7,steps = 3)
  142. end_fill()
  143. def mouth():
  144. """画嘴"""
  145. color("black", "#F35590")
  146. # 嘴唇
  147. penup()
  148. goto(-10, 22)
  149. pendown()
  150. begin_fill()
  151. setheading(260)
  152. forward(60)
  153. circle(-11, 150)
  154. forward(55)
  155. print(position())
  156. penup()
  157. goto(-38.46, 21.97)
  158. pendown()
  159. end_fill()
  160. # 舌头
  161. color("#6A070D", "#6A070D")
  162. begin_fill()
  163. penup()
  164. goto(-10.00, 22.00)
  165. pendown()
  166. penup()
  167. goto(-14.29, -1.7)
  168. pendown()
  169. penup()
  170. goto(-52, -5)
  171. pendown()
  172. penup()
  173. goto(-60.40, 12.74)
  174. pendown()
  175. penup()
  176. goto(-38.46, 21.97)
  177. pendown()
  178. penup()
  179. goto(-10.00, 22.00)
  180. pendown()
  181. end_fill()
  182. color("black","#FFD624")
  183. penup()
  184. goto(-78, 15)
  185. pendown()
  186. begin_fill()
  187. setheading(-25)
  188. for i in range(2):
  189. setheading(-25)
  190. circle(35, 70)
  191. end_fill()
  192. color("#AB1945", "#AB1945")
  193. penup()
  194. goto(-52, -5)
  195. pendown()
  196. begin_fill()
  197. setheading(40)
  198. circle(-33, 70)
  199. goto(-16,-1.7)
  200. penup()
  201. goto(-18,-17)
  202. pendown()
  203. setheading(155)
  204. circle(25, 70)
  205. end_fill()
  206. def ear():
  207. """画耳朵"""
  208. # 左耳
  209. color("black","#FFD624")
  210. penup()
  211. goto(-145, 93)
  212. pendown()
  213. begin_fill()
  214. setheading(165)
  215. circle(-248,50)
  216. right(120)
  217. circle(-248,50)
  218. end_fill()
  219. color("black", "black")
  220. penup()
  221. goto(-240, 143)
  222. pendown()
  223. begin_fill()
  224. setheading(107)
  225. circle(-170, 25)
  226. left(80)
  227. circle(229, 15)
  228. left(120)
  229. circle(300, 15)
  230. end_fill()
  231. # 右耳
  232. color("black", "#FFD624")
  233. penup()
  234. goto(30, 136)
  235. pendown()
  236. begin_fill()
  237. setheading(64)
  238. circle(-248, 50)
  239. right(120)
  240. circle(-248, 50)
  241. end_fill()
  242. color("black", "black")
  243. penup()
  244. goto(160, 200)
  245. pendown()
  246. begin_fill()
  247. setheading(52)
  248. circle(170, 25)
  249. left(116)
  250. circle(229, 15)
  251. left(71)
  252. circle(-300, 15)
  253. end_fill()
  254. def setting():
  255. """设置参数"""
  256. pensize(2)
  257. # 隐藏海龟
  258. hideturtle()
  259. speed(10)
  260. def main():
  261. """主函数"""
  262. setting()
  263. face(-132,115)
  264. eye()
  265. cheek()
  266. nose()
  267. mouth()
  268. ear()
  269. done()
  270. if __name__ == '__main__':
  271. main()

结果:
在这里插入图片描述

小乌龟

  1. import turtleturtle.setup(1000,800)turtle.speed(6)turtle.colormode(255)turtle.color((0,0,0),(60,100,30))turtle.penup()turtle.goto(0,-200)turtle.pendown()turtle.begin_fill()turtle.circle(200)turtle.end_fill()turtle.pensize(2)turtle.penup()turtle.goto(190,-60)turtle.pendown()turtle.goto(-190,-60)turtle.penup()turtle.goto(190,60)turtle.pendown()turtle.goto(-190,60)turtle.penup()turtle.goto(60,190)turtle.pendown()turtle.goto(60,-190)turtle.penup()turtle.goto(-60,190)turtle.pendown()turtle.goto(-60,-190)turtle.penup()turtle.pensize(1)turtle.goto(20,198)turtle.penup()turtle.goto(0,200)turtle.pendown()turtle.color((0,0,0),(60,80,30))turtle.begin_fill()a=1turtle.speed(0)for i in range(120): if 0<=i<30 or 60<=i<=90: a=a+0.04 turtle.lt(3) turtle.fd(a) else: a=a-0.04 turtle.lt(3) turtle.fd(a)turtle.penup()turtle.end_fill()
  2. turtle.color((0,0,0),(255,255,255))turtle.goto(11,240)turtle.begin_fill()turtle.pendown()turtle.circle(5)turtle.end_fill()turtle.penup()turtle.end_fill()turtle.color((0,0,0),(255,255,255))turtle.goto(-11,240)turtle.begin_fill()turtle.pendown()turtle.circle(5)turtle.end_fill()turtle.penup()
  3. turtle.color((0,0,0),(0,0,0))turtle.goto(10,240)turtle.begin_fill()turtle.pendown()turtle.circle(3)turtle.end_fill()turtle.penup()turtle.end_fill()turtle.color((0,0,0),(0,0,0))turtle.goto(-10,240)turtle.begin_fill()turtle.pendown()turtle.circle(3)turtle.end_fill()turtle.penup()turtle.color((0,0,0),(60,80,30))turtle.goto(-120,150)turtle.pendown()turtle.seth(30)turtle.begin_fill()a=0.3for i in range(120): if 0<=i<30 or 60<=i<=90: a=a+0.06 turtle.lt(3) turtle.fd(a) else: a=a-0.06 turtle.lt(3) turtle.fd(a)turtle.end_fill()turtle.penup()turtle.goto(120,150)turtle.pendown()turtle.seth(-30)a=0.3turtle.begin_fill()for i in range(120): if 0<=i<30 or 60<=i<=90: a=a+0.06 turtle.lt(3) turtle.fd(a) else: a=a-0.06 turtle.lt(3) turtle.fd(a)turtle.penup()turtle.end_fill()turtle.goto(-120,-160)turtle.pendown()turtle.seth(-210)turtle.begin_fill()a=0.5for i in range(120): if 0<=i<30 or 60<=i<=90: a=a+0.03 turtle.lt(3) turtle.fd(a) else: a=a-0.03 turtle.lt(3) turtle.fd(a) turtle.penup()turtle.end_fill()turtle.goto(120,-160)turtle.pendown()turtle.seth(210)turtle.begin_fill()a=0.5for i in range(120): if 0<=i<30 or 60<=i<=90: a=a+0.03 turtle.lt(3) turtle.fd(a) else: a=a-0.03 turtle.lt(3) turtle.fd(a)turtle.end_fill()turtle.penup()turtle.goto(0,-200)turtle.seth(0)turtle.pendown()
  4. turtle.begin_fill()turtle.fd(10)turtle.seth(-105)turtle.fd(30)turtle.seth(105)turtle.fd(30)turtle.seth(0)turtle.fd(10)turtle.end_fill()turtle.hideturtle()turtle.mainloop()

结果:
在这里插入图片描述

五角圆环

  1. import turtle as t
  2. t.goto(100,0)
  3. for i in range(50):
  4. t.left(80)
  5. t.fd(100)
  6. t.left(135)
  7. t.fd(105)

结果:
在这里插入图片描述

大风车

  1. import turtle as t
  2. t.goto(100,0)
  3. for i in range(100):
  4. t.left(80)
  5. t.fd(100)
  6. t.left(135)
  7. t.fd(165)
  8. t.left(125)
  9. t.fd(115)

结果:
在这里插入图片描述
有什么错误的地方希望各位多多包含,也希望在评论区指出错误,小编会及时改正错误并从中吸取教训,同时也希望大家有什么好玩的程序能多多分享,把快乐带给更多人。

文章知识点与官方知识档案匹配,可进一步学习相关知识
Python入门技能树首页概览439949 人正在系统学习中
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/969022?site
推荐阅读
相关标签
  

闽ICP备14008679号