Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import turtle
- bob = turtle.Turtle()
- bob.left(90) # to point Turtle up
- bob.left(45) # to go to the left so I can have a spread of balloons
- balloon_colours = ["Red", "Blue", "Green", "Purple", "Orange"]
- for i in range(5): # i represents each iteration
- bob.right(15) # Offset by 15° so we can get a spread of balloons
- bob.pencolor("black") # Sets the colour of the string
- bob.forward(150) # Sets the length of the string
- bob.pencolor(balloon_colours[i]) # Set the colour of the balloon, I can use i to pick a different colour from the list
- bob.pensize(60) # This sets the size of the baloon, experiment...
- bob.forward(1) # Draw the balloon
- bob.pensize(1) # Reset the the pensize
- bob.penup()
- bob.backward(151) # Return Turtle to starting position
- bob.pendown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement