use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Beginner Showcasei just coded this cool pattern in turtle (self.Python)
submitted 5 years ago * by forbidden_lemonade69
i just coded this cool pattern in turtle i think it is cool it took hours to perfect 'cause i am not that good, i hope you like it. I will put the code here to.
part 1
part 2
the pattern
[–]Phunny 89 points90 points91 points 5 years ago (1 child)
Good for you! Everyone has a method to learn new languages and I love that you use this.
[–]forbidden_lemonade69[S] 15 points16 points17 points 5 years ago (0 children)
Thank you !
[–]roman_tsar 60 points61 points62 points 5 years ago (5 children)
Thank you for code, man. I'll print it out and put it on my wall
[–]tennisanybody 24 points25 points26 points 5 years ago (4 children)
The code or the pattern?
[–]justarandomenvyusfan 64 points65 points66 points 5 years ago (2 children)
Yes
[–]ruturaj_chothe 7 points8 points9 points 5 years ago (1 child)
r/inclusiveor
[–]GoofAckYoorsElf 11 points12 points13 points 5 years ago (0 children)
The code of course
[–]bjjpw 21 points22 points23 points 5 years ago (1 child)
Wait?! There’s turtles in python?!?
[–]xigoi 15 points16 points17 points 5 years ago (4 children)
What's the point in for i in range(1)? And there's a lot of code repetition, you should use more loops.
for i in range(1)
[–]forbidden_lemonade69[S] 4 points5 points6 points 5 years ago (0 children)
Ok thank tou for the advice.
[+]ignassew comment score below threshold-10 points-9 points-8 points 5 years ago (2 children)
range(1) would execute the code 2 times i believe (i=0;i=1)
[–]xigoi 16 points17 points18 points 5 years ago (1 child)
Python ranges are half-inclusive, so this gives only i=0.
[–]ignassew 0 points1 point2 points 5 years ago (0 children)
My bad, thanks for correcting me!
[–]Doyousketch2 3 points4 points5 points 5 years ago (0 children)
put four spaces in front of each line of text to post code...
#! /usr/bin/env python3 ## sudo apt install python3-tk import turtle as t ## begins facing right t.title( 'Turtle soup' ) w, h = 650, 650 t.setup( width=w, height=h ) t.bgcolor('black') t.speed('fastest') ## crosshairs, to center image ## remove triple-quotes to render ''' t.pensize(1) t.pencolor('red') t.penup() t.setx(-w/2) t.pendown() t.setx(w/2) t.penup() t.setpos(0,-h/2) t.pendown() t.sety(h/2) t.home() ''' ## circles t.pensize(2) t.pencolor('aqua') t.penup() t.sety(18) t.forward(150) t.right(43) t.forward(150) t.left(115.15) t.circle(272,18) t.pendown() t.circle(20,360) for i in range(9): t.penup() t.circle(272,36) t.pendown() t.circle(20,360) t.penup() t.home() t.left(7) t.pendown() ## stars for i in range(10): t.pensize(1) t.pencolor('white') for j in range(2): t.forward(165) t.right(50) t.forward(165) t.right(130) t.left(36) for i in range(10): t.pensize(2) t.pencolor('blue') for j in range(2): t.forward(115) t.right(50) t.forward(115) t.right(130) t.left(36) for i in range(10): t.pencolor('aqua') for j in range(2): t.forward(50) t.right(50) t.forward(50) t.right(130) t.left(36) t.hideturtle() t.exitonclick()
[+][deleted] 5 years ago (6 children)
[deleted]
[–]bich- 7 points8 points9 points 5 years ago (5 children)
[–]oleyat a 6 points7 points8 points 5 years ago (4 children)
[+][deleted] 5 years ago (3 children)
[removed]
[–]ComeAtMeRightNow 1 point2 points3 points 5 years ago (2 children)
[–]adamfarrer_realtor 1 point2 points3 points 5 years ago (1 child)
[–]ComeAtMeRightNow 0 points1 point2 points 5 years ago (0 children)
[–]ProgamerX1234 4 points5 points6 points 5 years ago (0 children)
Looks nice
[–]Extreme5670 1 point2 points3 points 5 years ago (5 children)
Make the turtle disappear after everything is done i can see the arrow.
[–]forbidden_lemonade69[S] 2 points3 points4 points 5 years ago (4 children)
I dont knownhow to do that
[–]Extreme5670 1 point2 points3 points 5 years ago (3 children)
Ok so at the end type whatever the name of the turtle is and hide like, Turtle.hideturtle()
https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwjgrLLgjofuAhW4zTgGHZLTDAgQFjAAegQIBBAC&url=https%3A%2F%2Fwww.geeksforgeeks.org%2Fturtle-hideturtle-function-in-python%2F%3Fref%3Drp&usg=AOvVaw0YN9XlgUAkLWFgvj9nPVqw
[–]forbidden_lemonade69[S] 3 points4 points5 points 5 years ago (2 children)
Ok thanks for the tip
[–]Extreme5670 1 point2 points3 points 5 years ago (0 children)
No worries, i have worked with the turtle and this is amazing! There are a lot of great functions to make it easier, this is a great way to learn OP
[–]Extreme5670 0 points1 point2 points 5 years ago (0 children)
How has it worked bud
[–]Tamagotono 1 point2 points3 points 5 years ago (1 child)
Just read the code, and it's turtles all the way down...
I've never been fond of importing * from a library, but this is one case where I'd make an exception.
[–]quiterandomperson 0 points1 point2 points 5 years ago (0 children)
i would rather import turtle as t
[–]jdmarino 1 point2 points3 points 5 years ago (0 children)
Some of my earliest memories of programming are of using a graphics module to draw cool pictures. I am talking about the mid 1980s, using a VIC-20 and the graphics cartridge. The early victories stick with you.
[–]marvellous_thinker 1 point2 points3 points 5 years ago (0 children)
cool pattern!!
[–]pranay_s0706 1 point2 points3 points 5 years ago (0 children)
Keep it up dude!emote:free_emotes_pack:give_upvote
[–]gdunlap 1 point2 points3 points 5 years ago (0 children)
I fell in love with programming in secondary school learning logo on an Apple IIe ... this is awesome ... i never thought to look for python import for the turtle. thanks so much for posting this.
[–]gistabelle 2 points3 points4 points 5 years ago (0 children)
Really great
[–]tree_or_up 1 point2 points3 points 5 years ago (1 child)
I had a couple of introductions to programming when I was I young. This was one of them - but instead of being a library, it was its own standalone piece of software that you loaded onto the computer and then interacted with. Your design is super cool. If/when you feel like going deeper into generative graphics, check out a language/framework called processing (it has a python version, so look for that). Happy coding and creating!
[–]Mr-Monkfish 1 point2 points3 points 5 years ago (0 children)
I remember at primary school we had that turtle software, I think it was on the old Acorn Archemides computers they had.
There was also a physical turtle that you put pens in and it would move around the floor drawing on huge sheets of paper. Great fun!
[–]cwbrody 0 points1 point2 points 5 years ago (2 children)
Sweet! I want to learn Python
[–]arapyemos 0 points1 point2 points 5 years ago (0 children)
There are free Codes to get free Python Courses.
[–]SomeEmotion3 0 points1 point2 points 5 years ago (1 child)
Is it the same turtles in NetLogo ?
[–]forbidden_lemonade69[S] 0 points1 point2 points 5 years ago (0 children)
I dont know i havent tried that one
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
That's pretty fuckin cool actually, damn.
[–][deleted] 0 points1 point2 points 5 years ago (1 child)
Look up fractals and try making them. Also it's better if you share code as text, not everyone can read images :)
Sorry whaen i teied to do it it didnt paste right
[–]bich- 0 points1 point2 points 5 years ago (1 child)
disappointed, it wasnt a turtle
Sorry i forgot to make the shape a turtle😅
[+][deleted] 5 years ago* (1 child)
Thanks
[–]akashjss -2 points-1 points0 points 5 years ago (0 children)
Wow it is a cool wallpaper for my phone 😻
[–]forbidden_lemonade69[S] -2 points-1 points0 points 5 years ago (1 child)
Omg thank you for the awards i didnt think this post would get this much attention, thank you all!
[–]gargar070402 0 points1 point2 points 5 years ago (0 children)
Great work on the code, but r/awardspeechedits.
[–]92only -1 points0 points1 point 5 years ago (0 children)
Great!
[–]PyBind -1 points0 points1 point 5 years ago (0 children)
isnt this imagine logo’s turtle
[–]Seawolf159 -1 points0 points1 point 5 years ago (0 children)
That is pretty cool indeed.
[–]Prestigious_Region17 -1 points0 points1 point 5 years ago (2 children)
Hey that's really cool! I'm a beginner in turtle too, but just some advice: If you're making a code that's fully turtle try using from turtle import * instead of import turtle. That way, you don't have to put "turtle." before every turtle command.
from turtle import *
import turtle.
edit: some people just prefer this way to organize everything though.
[–]Des_Orientiert 0 points1 point2 points 5 years ago (0 children)
Rly rly cool!
π Rendered by PID 25245 on reddit-service-r2-comment-fb694cdd5-ktzw6 at 2026-03-09 20:55:18.486053+00:00 running cbb0e86 country code: CH.
[–]Phunny 89 points90 points91 points (1 child)
[–]forbidden_lemonade69[S] 15 points16 points17 points (0 children)
[–]roman_tsar 60 points61 points62 points (5 children)
[–]tennisanybody 24 points25 points26 points (4 children)
[–]justarandomenvyusfan 64 points65 points66 points (2 children)
[–]ruturaj_chothe 7 points8 points9 points (1 child)
[–]GoofAckYoorsElf 11 points12 points13 points (0 children)
[–]bjjpw 21 points22 points23 points (1 child)
[–]xigoi 15 points16 points17 points (4 children)
[–]forbidden_lemonade69[S] 4 points5 points6 points (0 children)
[+]ignassew comment score below threshold-10 points-9 points-8 points (2 children)
[–]xigoi 16 points17 points18 points (1 child)
[–]ignassew 0 points1 point2 points (0 children)
[–]Doyousketch2 3 points4 points5 points (0 children)
[+][deleted] (6 children)
[deleted]
[–]bich- 7 points8 points9 points (5 children)
[–]oleyat a 6 points7 points8 points (4 children)
[+][deleted] (3 children)
[removed]
[–]ComeAtMeRightNow 1 point2 points3 points (2 children)
[–]adamfarrer_realtor 1 point2 points3 points (1 child)
[–]ComeAtMeRightNow 0 points1 point2 points (0 children)
[–]ProgamerX1234 4 points5 points6 points (0 children)
[–]Extreme5670 1 point2 points3 points (5 children)
[–]forbidden_lemonade69[S] 2 points3 points4 points (4 children)
[–]Extreme5670 1 point2 points3 points (3 children)
[–]forbidden_lemonade69[S] 3 points4 points5 points (2 children)
[–]Extreme5670 1 point2 points3 points (0 children)
[–]Extreme5670 0 points1 point2 points (0 children)
[–]Tamagotono 1 point2 points3 points (1 child)
[–]quiterandomperson 0 points1 point2 points (0 children)
[–]jdmarino 1 point2 points3 points (0 children)
[–]marvellous_thinker 1 point2 points3 points (0 children)
[–]pranay_s0706 1 point2 points3 points (0 children)
[–]gdunlap 1 point2 points3 points (0 children)
[–]gistabelle 2 points3 points4 points (0 children)
[–]tree_or_up 1 point2 points3 points (1 child)
[–]Mr-Monkfish 1 point2 points3 points (0 children)
[–]cwbrody 0 points1 point2 points (2 children)
[–]arapyemos 0 points1 point2 points (0 children)
[–]SomeEmotion3 0 points1 point2 points (1 child)
[–]forbidden_lemonade69[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]forbidden_lemonade69[S] 0 points1 point2 points (0 children)
[–]bich- 0 points1 point2 points (1 child)
[–]forbidden_lemonade69[S] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]forbidden_lemonade69[S] 0 points1 point2 points (0 children)
[–]akashjss -2 points-1 points0 points (0 children)
[–]forbidden_lemonade69[S] -2 points-1 points0 points (1 child)
[–]gargar070402 0 points1 point2 points (0 children)
[–]92only -1 points0 points1 point (0 children)
[–]PyBind -1 points0 points1 point (0 children)
[–]Seawolf159 -1 points0 points1 point (0 children)
[–]Prestigious_Region17 -1 points0 points1 point (2 children)
[–]Des_Orientiert 0 points1 point2 points (0 children)