Created
February 16, 2017 05:41
-
-
Save sweetlearn/c579778effb5db6bee293be3cdad5514 to your computer and use it in GitHub Desktop.
python turtle example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import turtle | |
| import turtle | |
| wn = turtle.Screen() | |
| wn.bgcolor("red") | |
| tess = turtle.Turtle() | |
| tess.shape("turtle") | |
| tess.color("blue") | |
| tess.penup() # This is new | |
| size = 30 | |
| for i in range(90): | |
| tess.stamp() # Leave an impression on the canvas | |
| size = size + 2 # Increase the size on every iteration | |
| tess.forward(size) # Move tess along | |
| tess.right(50) # ... and turn her | |
| wn.mainloop() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
just for fun !!!