Learn to Code via Tutorials on Repl.it!

← Back to all posts
Rainbow spiral
NVVC007 (3)

Hi everyone! Here, I'm going to teach you how to make a simple yet fun turtle animation in python! So first, we start with making a repl. Choose the language: Python (with Turtle). Here comes the code! The first line is:

from turtle import *

In the next line, we write

babbage

or whatever word. So, basically, the line would be like this:

your_word_here word = turtle()

And in the next line,

wn = Screen()

And then we write

screen.bgcolor("black")
colours = ["red", "purple", "blue", "green", "orange", "yellow"]

And then, the final touch:

for i in range(360):
	turtle.color(colours[i % 6])
	turtle.width(i / 100 + 1)
	turtle.forward(i)
	turtle.left(59)

The final product should be looking like this:

from turtle import *
turtle = Turtle()
screen = Screen()
screen.bgcolor("black")
colours = ["red", "purple", "blue", "green", "orange", "yellow"]
for i in range(360):
	turtle.color(colours[i % 6])
	turtle.width(i / 100 + 1)
	turtle.forward(i)
	turtle.left(59)

Thanks for reading this tutorial! And it's kinda hypnotic, or makes you hypnotized😋.

Comments
hotnewtop
JWZ6 (251)

THIS IS DOPE (EPIC!!!!!!)

NVVC007 (3)

@JWZ6 Thanks! Thanks a lot!

DynamicSquid (4629)

Hello, we’ve unlisted this post as it doesn't seem like a proper tutorial. Tutorials are meant to cover a specific topic, and be somewhat in depth in explanation. You can view a good example of a tutorial here. If you have any questions, feel free to ask.