Sorry that this post isn’t very festive.
I challenged myself to create an interesting drawing with Python turtle using only four lines of code – here’s the result.
import turtle for i in range (100000000): turtle.forward(25) turtle.left(i*3)
Here’s what the code eventually creates:
Here’s the run-through of the code:
import turtle #import the turtle module for i in range (100000000): #repeat 100000000 times; turtle.forward(25) #move forward 25 pixels turtle.left(i*3) #turn left i times three degrees
Do you have a different idea for a pattern made with only four lines of code? Share it here!