Guest User

Untitled

a guest
Nov 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. import turtle #sets up the turtle graphic
  2. t=turtle.Pen()
  3. turtle.bgcolor("black")
  4. colors= ["red", "black", "red", "black"]
  5. family= [] #set up a list of family names
  6.  
  7. #ask the user for there name
  8. name=turtle.textinput ("My family","Enter a name, or just hit [ENTER] to end:")
  9. #Keep asking
  10. while name !="":
  11. family.append(name)
  12. name=turtle.textinput("My family", "Enter a name, or just hit [Enter] to end:")
  13. for x in range (100):
  14. t.pencolor(colors[x%len(family)]) #Rotate through the colors
  15. t.penup()
  16. t.forward(x*4)
  17. t.write(family[x%len(family)], font=("Arial",int((x+4)/4),"bold"))
  18. t.left(360/len(family)+2)
Add Comment
Please, Sign In to add comment