Hey guys, if you faced: "turtle.TurtleGraphicsError: bad color string: blue", it is because you have a whitespace (space) in your colors = [], just remove the whitespace will do. By error triggerer... btw. really enjoy your video and thanks for your sharing.
Heya, i'm a python newbie. i'm trying to understand the use of random.randrange(). tim specified 0 as a first parameter (0, len(colors)) and i wonder if that maens there is a chance for it to fail ? It's supposed to give a color, but has a chance to return 0 instead, doesn't it ?
Okay, fast forward an hour, and i understand now that the random.randrange() function does not return a color, but a number. And by using the colors[ ] table later, we can turn that number into a string from inside the table, which will always be a color. The parameters will always be between 0 and 7 (the max number of colors, determined thanks to len( ) )
Great video! I'm using 3.7.2 When I'm drawing the random circles, turtle doesn't make a "track". It just goes around one time and then fills the shape.
shouldnt the randcolor be.. randcolor = random.randrange(0, len(colors) - 1)? Since that random integrer thats being selected can actually achieve the min and max values of our tuple and if it does the max value would be 7 and colors[7] does not exist!
for the first, it says: Traceback (most recent call last): File "/Users/(I'm not gonna show you this)/Documents/(nope not gonna show you this either).py", line 6, in tu.color('red', 'blue') File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/turtle.py", line 2217, in color pcolor = self._colorstr(pcolor) AttributeError: 'str' object has no attribute '_colorstr'
and this is my code: import turtle import random tu = turtle.Turtle colors = ['red', 'blue', 'green', 'blue', 'purple'] tu.color('red', 'blue') tu.width(5) tu.begin_fill() tu.circle(50) tu.end_fill()
Hey guys, if you faced: "turtle.TurtleGraphicsError: bad color string: blue", it is because you have a whitespace (space) in your colors = [], just remove the whitespace will do. By error triggerer... btw. really enjoy your video and thanks for your sharing.
Tim you are the Best You explain it so well! (and your voice is so comforting)
Always gonna recommend this to python newbies ⭐⭐⭐⭐⭐
Heya, i'm a python newbie. i'm trying to understand the use of random.randrange(). tim specified 0 as a first parameter (0, len(colors)) and i wonder if that maens there is a chance for it to fail ? It's supposed to give a color, but has a chance to return 0 instead, doesn't it ?
Okay, fast forward an hour, and i understand now that the random.randrange() function does not return a color, but a number. And by using the colors[ ] table later, we can turn that number into a string from inside the table, which will always be a color. The parameters will always be between 0 and 7 (the max number of colors, determined thanks to len( ) )
Cool...I like your delivery!
Great video!
I'm using 3.7.2 When I'm drawing the random circles, turtle doesn't make a "track". It just goes around one time and then fills the shape.
nvm. I forgot to put closed brackets after my tim.pendown command. It didn't gave me an error message ;)
How do you make the radius of the circle after it has been drawn?
best python youtuber ever
Hey, whats the difference between random.randint and random.randrange
The best tutorial! Thank you vety much!!!
great ,,can we color the turtle too?
Loooooove this serie❤
Its saying
Bad color string
great work
I am learning python good by now
where did you define randrange it shows and error saying randrange not defined
Me too
I used random.choice(colors)
Well wish I knew you could do that earlier...
Thx
And I also don't understand how you were able to move the turtle forward, turn right and move it backward and move it left and then move it upward
how to clear the screen after drawing
you first make a variable called:
screen = turtle.Screen( )
then you do:
screen.clear( )
Can you do it for version 3.7.3
PLEASEEEEEEEEEEEEEEE
it's the same for both versions
can you please explain the last part more briefly ?....
Great hero
shouldnt the randcolor be..
randcolor = random.randrange(0, len(colors) - 1)?
Since that random integrer thats being selected can actually achieve the min and max values of our tuple and if it does the max value would be 7 and colors[7] does not exist!
Please tell us how to make a game
thank you sir !
Hi Tim please what does for x in range do
it helps you iterate using x variable... "for x in range (5)", means x will start from 0 and grow all the way upto 4... It is similar to "x=0; x
Great learning how can i contact you
for the first, it says:
Traceback (most recent call last):
File "/Users/(I'm not gonna show you this)/Documents/(nope not gonna show you this either).py", line 6, in
tu.color('red', 'blue')
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/turtle.py", line 2217, in color
pcolor = self._colorstr(pcolor)
AttributeError: 'str' object has no attribute '_colorstr'
and this is my code:
import turtle
import random
tu = turtle.Turtle
colors = ['red', 'blue', 'green', 'blue', 'purple']
tu.color('red', 'blue')
tu.width(5)
tu.begin_fill()
tu.circle(50)
tu.end_fill()
Good jobb, many thanks
It keeps crashing
Can't seem to find part 3 :(
Part 3 is up now!
do i have to separately download something for the turtle graphics????
No, turtle is built-in. Just make sure you have "import turtle" at the top
nice videi
⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟
i love u
video
666 likes. I am very scared
please activate windows lmao