Python Turtle Graphics Tutorial #2 - Shapes and Fills

Поділитися
Вставка
  • Опубліковано 15 лис 2024

КОМЕНТАРІ • 49

  • @yuan6780
    @yuan6780 5 років тому +14

    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.

  • @manyachaudhary9400
    @manyachaudhary9400 2 роки тому +3

    Tim you are the Best You explain it so well! (and your voice is so comforting)

  • @supermm1785
    @supermm1785 4 роки тому +16

    Always gonna recommend this to python newbies ⭐⭐⭐⭐⭐

    • @kaporalhart
      @kaporalhart Рік тому

      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 ?

    • @kaporalhart
      @kaporalhart Рік тому

      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( ) )

  • @TheSuccessfulLeader
    @TheSuccessfulLeader 5 років тому +7

    Cool...I like your delivery!

  • @johannes9509
    @johannes9509 4 роки тому +5

    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.

    • @johannes9509
      @johannes9509 4 роки тому +2

      nvm. I forgot to put closed brackets after my tim.pendown command. It didn't gave me an error message ;)

  • @kavishdesai4839
    @kavishdesai4839 4 роки тому +3

    How do you make the radius of the circle after it has been drawn?

  • @flaminfox7405
    @flaminfox7405 4 роки тому

    best python youtuber ever

  • @KRGAMING
    @KRGAMING 4 роки тому +1

    Hey, whats the difference between random.randint and random.randrange

  • @ИльяРоботов-й2т
    @ИльяРоботов-й2т 5 років тому +10

    The best tutorial! Thank you vety much!!!

  • @marinascopfzfa21on53
    @marinascopfzfa21on53 3 роки тому

    great ,,can we color the turtle too?

  • @Skugganloke
    @Skugganloke Рік тому

    Loooooove this serie❤

  • @legitShivam
    @legitShivam 4 роки тому +3

    Its saying
    Bad color string

  • @tsmspace
    @tsmspace 5 років тому +1

    great work
    I am learning python good by now

  • @premiummonkey1631
    @premiummonkey1631 4 роки тому +2

    where did you define randrange it shows and error saying randrange not defined

  • @markmahathey8518
    @markmahathey8518 6 років тому +11

    I used random.choice(colors)

    • @TechWithTim
      @TechWithTim  6 років тому +2

      Well wish I knew you could do that earlier...

    • @9b_vajra4
      @9b_vajra4 4 роки тому

      Thx

  • @habibatozemoka9946
    @habibatozemoka9946 4 роки тому

    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

  • @jocep
    @jocep 5 років тому +2

    how to clear the screen after drawing

    • @harmannatsingh3933
      @harmannatsingh3933 5 років тому +3

      you first make a variable called:
      screen = turtle.Screen( )
      then you do:
      screen.clear( )

  • @bilal_ahmed07
    @bilal_ahmed07 5 років тому +3

    Can you do it for version 3.7.3
    PLEASEEEEEEEEEEEEEEE

  • @mshimanshu1000
    @mshimanshu1000 4 роки тому

    can you please explain the last part more briefly ?....

  • @abhishekkalagurki959
    @abhishekkalagurki959 4 роки тому

    Great hero

  • @francosalvatore5442
    @francosalvatore5442 4 роки тому

    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!

  • @theherobrine3428
    @theherobrine3428 Рік тому

    Please tell us how to make a game

  • @tanubhavkatiyar7140
    @tanubhavkatiyar7140 4 роки тому +1

    thank you sir !

  • @habibatozemoka9946
    @habibatozemoka9946 4 роки тому

    Hi Tim please what does for x in range do

    • @ajeethsuryash5123
      @ajeethsuryash5123 4 роки тому

      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

  • @shivamkumarsakolia5580
    @shivamkumarsakolia5580 3 роки тому

    Great learning how can i contact you

  • @GXboy12345
    @GXboy12345 4 роки тому

    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'

    • @GXboy12345
      @GXboy12345 4 роки тому

      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()

  • @IAMSAEID
    @IAMSAEID 5 років тому +1

    Good jobb, many thanks

  • @johnjohansson
    @johnjohansson 3 роки тому

    It keeps crashing

  • @mehrdadg4741
    @mehrdadg4741 6 років тому

    Can't seem to find part 3 :(

  • @mof8753
    @mof8753 4 роки тому

    do i have to separately download something for the turtle graphics????

    • @userdetails1
      @userdetails1 4 роки тому

      No, turtle is built-in. Just make sure you have "import turtle" at the top

  • @jaedonbeckford101
    @jaedonbeckford101 6 років тому +1

    nice videi

  • @theherobrine3428
    @theherobrine3428 Рік тому

    ⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟🌟

  • @MuntadherYaseen
    @MuntadherYaseen 4 роки тому

    i love u

  • @jaedonbeckford101
    @jaedonbeckford101 6 років тому +1

    video

  • @andymyung1132
    @andymyung1132 4 роки тому

    666 likes. I am very scared

  • @itscediix
    @itscediix 3 роки тому

    please activate windows lmao