Skip to content
Sign upLog in
← Back to Community

How To Create A Black Hole Spiral in Python W/ Turtle

Profile icon
nothplus

Hello Programmers,

This is a innovative and creative way of showing of your programming skills in Python with Turtle by creating this Spiral which later centres into a Black Hole.

Step 1 - Import and Name your turtle
Step 2 - Create a for - in range and mark anything more than 100
Step 3 - Go forward by 180 or more
Step 4 - Go left by 70 or more
Step 5 - Go forward by 60 or more
Step 6 - Go right by 40 or more
Step 7 - Pen up
Step 8 - Set position 0,0
Step 9 - Pen down
Step 10 - Go right by 2 or more

Challenge: Add Colour to make it a Rainbow Spiral

There you have it Ten Easy Steps to make a pretty fascinating Black Hole Spiral and impress other programmers.

Voters
Profile icon
KingstonWilks
Profile icon
Astroseven77
Profile icon
Aayushcode
Profile icon
zaarakhan
Profile icon
aaryaaluri
Profile icon
LordPancake
Profile icon
RuiFengFeng
Profile icon
LaraDemirel1
Profile icon
ebest
Profile icon
tsingh15
Comments
hotnewtop
Profile icon
SurfaceBreak

Kl work it looks a bit like a computer fan

Profile icon
[deleted]

Why don't you put this in a while True loop and let it run forever
https://repl.it/@IEATPYTHON/Black-Hole-Spiral-3D-modification
I made it so some of the turns were a random number. After running this for a bit it look 3 Dimensional!

Profile icon
nothplus

@IEATPYTHON
True! Thanks for the idea!

Profile icon
John_WardWard

@IEATPYTHON
Talking about loops, I made a tutorial on that, although it has only an upvote by myself:(.

Profile icon
Reader8765

@IEATPYTHON
Try this variation I made off yours! https://repl.it/@Reader8765/Black-Hole-Spiral-3D-modification

Profile icon
[deleted]

@Reader8765
cool!

Profile icon
2IsAPrimeNumber

@IEATPYTHON
Hi. I really like your modification. Here's a little trick I've heard: Hiding the turtle helps draw faster. I found this information here.

Profile icon
DanielSchumache

Now this is epic

Profile icon
nothplus

@DanielSchumache
Thanks Daniel

Profile icon
olivierkouassi

that's great , i like it

Profile icon
nothplus

@olivierkouassi
Thanks Oliver

Profile icon
John_WardWard

Maybe up the speed to 100 to make it quicker?

Profile icon
[deleted]

@John_WardWard You can only choose a speed between 0-10

Profile icon
ScubaHero

How do you open up result in a repl?

Profile icon
Mohanad_Alaas

@ScubaHero
It just opens when you upload your tutorial, thanks for the feedback, It would be great if you could support this tutorial as well if you really liked it!

Profile icon
[deleted]

@nothplus
I would set the turtle speed to 0 so that the turtle will go as fast as possible :)

Profile icon
John_WardWard

@IEATPYTHON
I actually didn't know 0 was fastest. This really was a tutorial:)

Profile icon
[deleted]

@nothplus
I used python turtle for my tutorial too! I figured you would enjoy!
https://repl.it/talk/challenge/Colorful-Circle-Spiral-Generator-Using-Python-Turtle/7532

Profile icon
[deleted]

@nothplus
would you be ok if I did a python turtle tutorial too which can make a really cool spiral. I really like your tutorial and I wanted to make on like this too :>

Profile icon
John_WardWard

@IEATPYTHON
If you're interested in this kind of stuff, I've got a pixel art creator tutorial you might want to see.

Profile icon
[deleted]

@John_WardWard Sure! If you are interested in turtle my turtle circle pattern generator is out

Profile icon
John_WardWard

@IEATPYTHON
Thanks, I'll check it out now.

Profile icon
nothplus

@IEATPYTHON
Ok sure be, but sure to credit me for it and I don't mind if you straight up use the same code!

Profile icon
[deleted]

@nothplus
For your tutorial I would suggest you use markdown so that it will look nicer.

With markdown you can make text bold: This text is bold
see it looks nice right

print("Your code will pop out like this")

If you want to know how to do this check out this Jser's tutorial right here>>>https://repl.it/talk/learn/A-Quick-Guide-to-Replit-Talk-Markdown/7448

Profile icon
2IsAPrimeNumber

Hello. I have a question about Python (with Turtle), because I also want to make a tutorial with Python (with Turtle). Anyways, what version of Python and Turtle is used in Python (with Turtle)?

Profile icon
2IsAPrimeNumber

Great tutorial, by the way!

Profile icon
nothplus

@2IsAPrimeNumber
Thanks for the feedback, It would be great if you could support this tutorial as well if you really liked it!

Profile icon
nothplus

@2IsAPrimeNumber
Yeah, when you are looking at the languages hover over them in the bottom right corner then select more languages, then search for Python and you want to pick the one that says "Python with Turtle" then there you have it!

Profile icon
2IsAPrimeNumber

@nothplus
Sorry it took so long for me to respond. What I meant in my question was what version of Turtle is used in Repl.it? For instance, Turtle 2.7, 3.7, etc. That's what I meant.

Profile icon
[deleted]

@2IsAPrimeNumber
It is 2.7 :)

Profile icon
nothplus

@IEATPYTHON
Thanks for having his back!

Profile icon
Blink

@IEATPYTHON
Why not Python?

Profile icon
2IsAPrimeNumber

@Blink
Python With Turtle uses a "palette"; a drawing area for the turtle. A repl is just a basic program for running text commands. You need to use a different kind of repl with a palette to use Python With Turtle.

Profile icon
John_WardWard

@Blink
Python has only got the console, and cannot open a canvas on repl. Turtle has console and canvas.

Profile icon
VidyaSuryanaray

Dang! That is sick! What coding language is it? Python or Python 2.7?

Profile icon
MomenMalik

AMAZING YOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.

Profile icon
ebest

What if you added turtle.tracer?

Profile icon
E_N_G_I_E

it crashed

Profile icon
Check_Mate

cool, but takes SOOOOO long

Profile icon
Charles686

Really good. Helped me a lot and has clear instructions!

Profile icon
2IsAPrimeNumber

Did you know that if the speed of the turtle is 0, the turtle won't have any animation; the turtle will just draw automatically without moving?

Profile icon
Agent421

There is a problem with my Result screen page, it just shows the top left corner of the screen so I can’t see my turtle doing it’s job, and when I drag the screen all the way to the right then I only see the half of the screen which shows the half of my spiral black hole, please help me fix it, thanks

Profile icon
John_WardWard

@Shams_the_coder Please send me a screenshot and I'll see if I can help. If not just report it in https://repl.it/bugs/ .

Profile icon
John_WardWard

@John_WardWard Or Maybe tell one of the repl team.

Profile icon
zog1

That's pretty cool. I think you should speed up and hide the pen though.

Profile icon
Reader8765

You can get cool effects when you scroll!

Profile icon
Mohanad_Alaas

@Reader8765
Wdym?

Profile icon
Mohanad_Alaas

@Reader8765
Also if you liked this tutorial a lot be sure to support it!

Profile icon
Reader8765

@Mohanad_Alaas Try scrolling when this is completely displayed.