Also if you want the Window to stay open after the turtle has completed the drawing so you can actually see it, include this code at the very end. turtle.done()
because this is an older version of python that he's doing it on you might have to include: wn = turtle.Screen() then put wn before anything related to the screen and with the pen to draw you might have to do this: pen = turtle.Turtle() and put the pen before anything related to the pen
from turtle import * bgcolor("black") pensize(2) speed(0) for i in range(6): for colours in ["red", "magenta", "blue","cyan","green","yellow","white"]: color(colours) circle(100) left(10) hideturtle()
import turtle turtle.bgcolor("black") turtle.pensize(2) turtle.speed(0) for i in range(6): for colours in ["red", "magenta", "blue", "cyan", "green", "yellow", "white"]: turtle.color(colours) turtle.circle(100) turtle.left(10) turtle.hideturtle()
import turtle screen = turtle.Screen() screen.bgcolor("black") turtle.pensize(1) turtle.speed(0) for i in range(8): for colors in ["blue", "orange", "yellow", "green", "red", "aqua", "blue", "red"]: turtle.color(colors) turtle.circle(20) turtle.left(6) turtle.backward(10) turtle.done() turtle.pensize(3) for i in range(6): for colors in ["blue", "red", "green", "blue", "red", "green", "blue", "red"]: turtle.color(colors) turtle.circle(40) turtle.left(20) turtle.backward(30) turtle.done()
Helloo again, I was actually trying this code to draw the spirograph, but this time I am trying to make it like a rainbow, for example, the 6 blue circles get regrouped only by themselves then the other colours go the same. Could you help me finish it? That's the program: from turtle import * speed(900) list1 = ["brown","red","magenta","blue","green","orange"] for i in range (36):
@@GeekTutorials1 Hahaha thanks for that functions. This is what I did when I want to move to a certain coordinate: (I actually drew a line with a white color pen, so it seems moving) vDraw.pencolor ("white") vDraw.right(90) vDraw.forward (10) vDraw.left(90) vDraw.forward (10) #------------ So now, I have this: vDraw.penup() vDraw.goto(vDraw.xcor() + 10, vDraw.ycor()+ 10) vDraw.pendown() #----------- Thanks
I used a slightly different program: from turtle import * color("black") width(2) speed(50) for i in range(6): for colors in ("red" , "magenta" , "blue" , "cyan" , "green" , "yellow" ,"orange"): color(colors) circle(100) left(10) exitonclick()
Because he chose 6 colors and the nested loop is running for a total of 36 times and after each iteration it makes a 10 degree turn so in total a 360 degree turn
You basically draw a circle once on the page. You then repeat drawing this circle many times, each time changing the colour to one of the set colours. Each circle is slightly spaced apart from the previous.
@@GeekTutorials1 yes exactly but actually i have an exam and i really would like to get ur help 😅 it is asked to draw the same drawing with the same colours but using only one loop, can i get ur help please??😂❤️
Altered Code A Bit And Ended Up With A REALLY COOL PATTERN! import turtle screen = turtle.Screen() screen.bgcolor("black") turtle.pensize(5) turtle.speed(0) enabled = True while enabled == True: for colours in ["white", "red", "magenta", "blue", "cyan", "pink", "yellow", "orange"]: turtle.color(colours) turtle.circle(1000) turtle.left(5) turtle.done()
Mine says invalid syntax on the line that has the colors it doesn't run this is my code: import turtle turtle.bgcolor("black") turtle.pensize(2) turtle.speed(0) for i in range(6): for colours in ["red", "magenta", "blue", "cyan", "green", "yellow", "white"] turtle.color(colours) turtle.circle(100) turtle.left(10) turtle.hideturtle()
@@renusingh9254 i had a problem like this what i did was ctrl+shift+p search select interpreter click it then click python 3.8.5 64 bit sorry this is late
This is the script with a loop: while True: import turtle pen = turtle.Turtle(2) wn=turtle. Screen() wn. bgcolor("black") turtle.speed(0) for i in range(6): for colours in ["red", "blue", "magenta", "cyan", "green", "yellow", "white"]: turtle.color(colours) turtle.circle(100) turtle.left(10) turtle.hideturtle This is without: import turtle pen = turtle.Turtle(2) wn=turtle. Screen() wn. bgcolor("black") turtle.speed(0) for i in range(6): for colours in ["red", "blue", "magenta", "cyan", "green", "yellow", "white"]: turtle.color(colours) turtle.circle(100) turtle.left(10) turtle.hideturtle
Also if you want the Window to stay open after the turtle has completed the drawing so you can actually see it, include this code at the very end.
turtle.done()
or, add time.sleep(seconds)
because this is an older version of python that he's doing it on you might have to include:
wn = turtle.Screen() then put wn before anything related to the screen and with the pen to draw you might have to do this:
pen = turtle.Turtle() and put the pen before anything related to the pen
David Godwin thank you!
from turtle import *
bgcolor("black")
pensize(2)
speed(0)
for i in range(6):
for colours in ["red", "magenta", "blue","cyan","green","yellow","white"]:
color(colours)
circle(100)
left(10)
hideturtle()
you r right
import turtle
turtle.bgcolor("black")
turtle.pensize(2)
turtle.speed(0)
for i in range(6):
for colours in ["red", "magenta", "blue", "cyan", "green", "yellow", "white"]:
turtle.color(colours)
turtle.circle(100)
turtle.left(10)
turtle.hideturtle()
Can the center be moved left/right and up and down so that the spirograph rotates three-dimensionally?
Worked! Thanks soo much!
With the same drawing, but I want every six consecutive circles to be the same color, how do I do that please help me
Thanks was struggling in project
AttributeError: partially initialized module 'turtle' has no attribute 'bgcolor' (most likely dur to circular import) ??
Which is the interface
thx sir for this clear explanation it helped me a lot and now pythin turtle is ez for me !!!
import turtle
screen = turtle.Screen()
screen.bgcolor("black")
turtle.pensize(1)
turtle.speed(0)
for i in range(8):
for colors in ["blue", "orange", "yellow", "green", "red", "aqua", "blue", "red"]:
turtle.color(colors)
turtle.circle(20)
turtle.left(6)
turtle.backward(10)
turtle.done()
turtle.pensize(3)
for i in range(6):
for colors in ["blue", "red", "green", "blue", "red", "green", "blue", "red"]:
turtle.color(colors)
turtle.circle(40)
turtle.left(20)
turtle.backward(30)
turtle.done()
Showing error turtle is not defined
I cant do this.Iam using idle 3.10
Hello mate , can you help me draw this spirograph without using the circle function and it should involve only one loop
And not any def function also
What program do you use
These days, I use Mu.
codewith.mu
Thanks
It worked good for me, Idk much about python but gotta ask that can I save that art?
I don't think so. Take a screenshot of it though and you could save a small copy.
@@GeekTutorials1 Thanks for you're reply :)
Helloo again, I was actually trying this code to draw the spirograph, but this time I am trying to make it like a rainbow, for example, the 6 blue circles get regrouped only by themselves then the other colours go the same. Could you help me finish it?
That's the program:
from turtle import *
speed(900)
list1 = ["brown","red","magenta","blue","green","orange"]
for i in range (36):
pencolor(list1[i%6])
circle(100)
right(10)
Someone who understands. What word should I use when I want to determine the initial position of the turtle?
The initial position is always 0,0
Does that mean it can't be changed?
@@睾丸おいしい It can easily be changed by using the goto() function.
For example
penup()
goto(100, 200)
pendown()
@@GeekTutorials1 Hahaha thanks for that functions.
This is what I did when I want to move to a certain coordinate: (I actually drew a line with a white color pen, so it seems moving)
vDraw.pencolor ("white")
vDraw.right(90)
vDraw.forward (10)
vDraw.left(90)
vDraw.forward (10)
#------------
So now, I have this:
vDraw.penup()
vDraw.goto(vDraw.xcor() + 10, vDraw.ycor()+ 10)
vDraw.pendown()
#-----------
Thanks
Stupendous sir, I got it at 1st attempt itself. Very well explained.
Thank you.This was very easy to follow.
where it can code and run this ????
I use codewith.mu
Amazing so understandable and easy to follow!
Glad it was helpful!
afe
awsd
I used a slightly different program:
from turtle import *
color("black")
width(2)
speed(50)
for i in range(6):
for colors in ("red" , "magenta" , "blue" , "cyan" , "green" , "yellow" ,"orange"):
color(colors)
circle(100)
left(10)
exitonclick()
can someone send a link to download python
www.python.org/downloads/
I prefer to use codewith.mu if you are a beginner.
@geek tutorials why is range chosen 6 here ?
I just thought it looked best. Try and change it to 5 or another number - see if you like the effect it produces.
Because he chose 6 colors and the nested loop is running for a total of 36 times and after each iteration it makes a 10 degree turn so in total a 360 degree turn
Whats apps are u using? Im currently using spyder from anaconda
Nice, mate. I'm just using the general Python IDLE. Nothing fancy this way.
@@GeekTutorials1 owh thx it was so laggy with spyder eww i cant stand it hahahaha
@@GeekTutorials1 now im using idle too and it works smoothly
And restarting turtle wont take so long with idle,100 times faster than spyder
where do you code
At home - sometimes in my study, sometimes on the toilet. Wherever
@@GeekTutorials1 I thought which editor
@@borissajlovic3208 it's called Code with Mu
in my notebook it is showing error
What's the error you have?
why did you have it loop 6 times?
It was enough rotations to make a complete circular shape.. It was a bit of trial and error to get that number.
6 colors looping 6 times with a 10 degree rotation => 6x6x10 = 360° full circle, I guess
thx for this code it helped me in my project
youtube.com/@Mukeshtiger2468si=vrsJ8xio9EJQU8gP
from turtle import *
#the we don't need to type turtle in every function
It works!!!!!!!!!!! Thank you for teaching the coding!!!!!
What is the use of turtle.left(10) ??
Turn the turtle left by 10 degrees
It's working but i can't understand the code
You basically draw a circle once on the page. You then repeat drawing this circle many times, each time changing the colour to one of the set colours. Each circle is slightly spaced apart from the previous.
Hello, thank you for this helpful video. Can you make another video with the same result but using only one loop not a nested loop?
You can, but it would lose the multi colour effect?
@@GeekTutorials1 yes exactly but actually i have an exam and i really would like to get ur help 😅 it is asked to draw the same drawing with the same colours but using only one loop, can i get ur help please??😂❤️
@@ejs961 That would be rather tedious, I'd imagine. I will look into it for you.
@@GeekTutorials1 Thank you so much for your interest in helping. You're amazing. So thankful🙏
@@pain1946 no actually im in Lebanon
File "e:\Software\python\circle.py", line 9, in
turtle.color(colours)
NameError: name 'colours' is not defined
Check where you spelt colours earlier - is it spelt the same? Case sensitive.
You are awesome, and your skills ❤️❤️❤️👍
thank you, it was easy to understand :D
It's showing.attribute error..turtle has no bgcolour
Spell colour the American way - without the 'u'
color
becz its an old version and no its saays the saame
@@memeteam8611 Works for me in the latest and older version. Must be a very old version they are using?
Btw iam repl it website
If u can try to make the same thing or something else on repl it it would be pleasure ☺️
Thanks A Lot!
It Worked!
can i make the background multicolour?
You could if you wanted to.
@@GeekTutorials1 what code would i need to do, cos i tried everything i know and nothing worked.
@@misan2002 Just click Run. You don't need to save it if you don't want to. And you don't need to press F5. Just click Run.
@@twinkle_6260 do u know the code for it
it is showing that there is a syntax error
That usually means you forgot a bracket, quotation marks, comma, etc. It's usually a punctuation issue
oh yeah
thank you
It's not working on vscode
It's not just working
Tried it a lot of times
try his new version th-cam.com/video/Jmg99sKAxqQ/w-d-xo.html
What is the app name
It's the official Python app. I use Python IDLE
for use it in vs code, first use a while True
But the results didn't came but when I changed some of the words then it finally popped up thanks anyway
It's not working
Help me
Do you get an error message? What's not working exactly?
@@GeekTutorials1 now it's okay the problem was from the laptop.
Thank you . It's too nice .
@@GeekTutorials1 invalid syntax
@@lehenge_me_wifi8406 Yeah good.
why did u write i?
It's just a random letter that I chose. You can replace the 'i' with any word or letter that you'd like.
@@GeekTutorials1 ah thank you
Wow Sir! I like it Keep It Up Like That For Your Amazing Videos! Great Tutorials!
Altered Code A Bit And Ended Up With A REALLY COOL PATTERN!
import turtle
screen = turtle.Screen()
screen.bgcolor("black")
turtle.pensize(5)
turtle.speed(0)
enabled = True
while enabled == True:
for colours in ["white", "red", "magenta", "blue", "cyan", "pink", "yellow", "orange"]:
turtle.color(colours)
turtle.circle(1000)
turtle.left(5)
turtle.done()
it doesn't work for me.
What's the issue?
thank you soooooooooooooooo much buddy it helped me a looooooooooooot
Can you help me write the same code, but with a vacuum circle in the middle. I want to communicate with you
What is a vacuum circle? I am happy to help but don't understand your requests, sorry. I prefer to just connect here in the comments.
He means that the circles not to revolve around one point, but around empty circle
After the circle command, put a forward 10 or something then the left command and it should leave you with a nice little circle in the middle
Mine says invalid syntax on the line that has the colors it doesn't run this is my code:
import turtle
turtle.bgcolor("black")
turtle.pensize(2)
turtle.speed(0)
for i in range(6):
for colours in ["red", "magenta", "blue", "cyan", "green", "yellow", "white"]
turtle.color(colours)
turtle.circle(100)
turtle.left(10)
turtle.hideturtle()
Tough one. What does the error say exactly? I can't see a problem
@@GeekTutorials1 It says invalid syntax
@@HamzaAli-ou5ld There is always more to the error that pinpoints the exact location of the error. What else does it say?
@@GeekTutorials1 I fixed it the problem was that there was no ":" at the end of the color line
@Sasha Bennett Thank you it worked
why turtle is not working in IDLE
Either you didn’t input it or you need to upgrade to the newest IDLE
In my python it's showing attribute error!!🤔
RENAME the file for a random name and take the file to a new folder and maybe its gonna work,
Amazing code
Awesomee!!!
It's saying no module found of name Turtle😭. Pls help.
Try a lowercase 'T' in turtle.
@@GeekTutorials1 i tried but it is saying the same.😭
@@renusingh9254 i had a problem like this what i did was ctrl+shift+p search select interpreter click it then click python 3.8.5 64 bit sorry this is late
@@popcornstewart thank you very much.🙂
can you pass me the code? please is for school
The code is in the description of my other video.
th-cam.com/video/Jmg99sKAxqQ/w-d-xo.html
@@GeekTutorials1 Ty i love you
Pls tell what to do noe
its not working on updated version of python.
It works fine.
NameError: name 'turle' is not defined
Spell Turtle again - you're missing the second 't'
Wow!sir you are awesome
Is wark
There you can find many python projects with source code..
th-cam.com/play/PLX7Dd6nLHh86e4-fJC16MjsxkpraqdNoG.html
Thank you
tnx bro
Love it!
it's ( or [ ?
Depends hen you're using them - you will use both at different times.
May I get the source code
unfortunately this isn't work
It does work. We just need to find out what issue you're having... Tell me more
Amazing.
it is not supporting in my python man
What python are you running?
The speed is so slow of the notebook
It's not working for me my version is idle 3.9.1
Works fine this way.
it don't work for me?
Show me your code. It definitely works
good
that is soooo cool. bruh
I'm doin that right now. literaly
This is the script with a loop:
while True:
import turtle
pen = turtle.Turtle(2)
wn=turtle. Screen()
wn. bgcolor("black")
turtle.speed(0)
for i in range(6):
for colours in ["red", "blue", "magenta", "cyan", "green", "yellow", "white"]:
turtle.color(colours)
turtle.circle(100)
turtle.left(10)
turtle.hideturtle
This is without:
import turtle
pen = turtle.Turtle(2)
wn=turtle. Screen()
wn. bgcolor("black")
turtle.speed(0)
for i in range(6):
for colours in ["red", "blue", "magenta", "cyan", "green", "yellow", "white"]:
turtle.color(colours)
turtle.circle(100)
turtle.left(10)
turtle.hideturtle
i can't speed 0😐😐😐😐😐😐😐😐😐😐
Bugger. Do you have to sit and watch the whole thing draw slowly?
invalid sintax
Usually means you made a spelling error or forgot a bracket somewhere.
It's not work
If you watch the tutorial 'til the end, you will see that it does work just fine 👍
@@GeekTutorials1 let see