Advertisement
timber101

Turtle_Basics_Part_2

Mar 1st, 2022
587
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Python turtle basics
  2.  
  3. #  Links used https://docs.python.org/3/library/turtle.html#
  4. #  https://www.w3schools.com/colors/colors_names.asp
  5. #  https://html-color.codes/
  6.  
  7. import turtle # imports the Turtle Library
  8.  
  9. wn = turtle.Screen() # makes the window
  10. wn.bgcolor("#76ff7a")
  11.  
  12. bob = turtle.Turtle()
  13. bob.color("darkblue")
  14.  
  15. bob.penup()
  16. bob.goto(50,50)   # go to x pos by 50 and 5 pos
  17. bob.pendown()
  18.  
  19. bob.pensize(3)
  20. bob.begin_fill()
  21. for i in range(3):  # loop three times
  22.   bob.fd(160)
  23.   bob.lt(120)  # 360 /3 = 120
  24. bob.end_fill()
  25.  
  26. wn.exitonclick()
  27.  
Advertisement
RAW Paste Data Copied
Advertisement