You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

yinyang.py 1018B

3 months ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. from turtle import Turtle
  2. sophia = Turtle()
  3. zoe = Turtle()
  4. sophia.screen.bgcolor('grey')
  5. sophia.pencolor('black')
  6. sophia.fillcolor('black')
  7. zoe.pencolor('white')
  8. zoe.fillcolor('white')
  9. zoe.begin_fill()
  10. zoe.left(90)
  11. zoe.penup()
  12. zoe.forward(300)
  13. zoe.left(90)
  14. zoe.circle(150, 180)
  15. zoe.end_fill()
  16. sophia.begin_fill()
  17. sophia.circle(150, 180)
  18. sophia.penup()
  19. sophia.left(90)
  20. sophia.forward(300)
  21. sophia.left(90)
  22. sophia.end_fill()
  23. zoe.penup()
  24. zoe.left(90)
  25. zoe.forward(150)
  26. zoe.right(90)
  27. zoe.pendown()
  28. zoe.begin_fill()
  29. zoe.circle(75,180)
  30. zoe.left(90)
  31. zoe.forward(150)
  32. zoe.end_fill()
  33. sophia.pendown()
  34. sophia.begin_fill()
  35. sophia.left(90)
  36. sophia.forward(150)
  37. sophia.left(90)
  38. sophia.circle(75,180)
  39. sophia.end_fill()
  40. zoe.penup()
  41. zoe.forward(85)
  42. zoe.left(90)
  43. zoe.pendown()
  44. zoe.begin_fill()
  45. zoe.circle(10)
  46. zoe.end_fill()
  47. sophia.penup()
  48. sophia.left(90)
  49. sophia.forward(235)
  50. sophia.left(90)
  51. sophia.pendown()
  52. sophia.begin_fill()
  53. sophia.circle(10)
  54. sophia.end_fill()
  55. sophia.hideturtle()
  56. zoe.hideturtle()
  57. sophia.screen.mainloop()