Complete Python Turtle Graphics Overview! (From Beginner to Advanced)

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 685

  • @KeithGalli
    @KeithGalli  Před 6 lety +231

    Video Outline!
    0:25 - All Examples seen in this Video
    1:40 - Turtle Setup
    2:48 - Basic Lines & Turns
    5:22 - Creating Simple Shapes (Squares)
    8:00 - Common Mistakes
    8:30 - Adding color in Turtle
    11:46 - Pen up, Pen Down
    15:16 - Creating Complex Shapes (Flowers)
    22:19 - Using Math Library in Drawings
    26:41 - Recursive Stars Example
    Feel free to watch on 1.25x or 1.5x to learn faster!
    Thanks for watching :)
    SUBSCRIBE for future tutorials like this

    • @yaraabd6955
      @yaraabd6955 Před 5 lety

      Can you give me the name of program?

    • @KeithGalli
      @KeithGalli  Před 5 lety +7

      The turtle graphics library of python. The editor I'm using to write the python code is Sublime Text 3. Does this answer your question?

    • @KeithGalli
      @KeithGalli  Před 5 lety +2

      This library should come default with python so if you have that, you would have the turtle library. If you want the link to the code i wrote in this video, that's in the Description of the video.

    • @yaraabd6955
      @yaraabd6955 Před 5 lety +2

      Sorry if i disturbed you but i don't need this..
      you know the programe (Visual stdio , CodeBlocks..) like this .. 🙁

    • @KeithGalli
      @KeithGalli  Před 5 lety +2

      www.sublimetext.com/3

  • @KaosWater
    @KaosWater Před 4 lety +217

    "You made a square, yay!" That also was my reaction as well when I did it. Programming is awesome.

  • @nourgamer1098
    @nourgamer1098 Před 3 lety +55

    My man stayed up at 3am to educate us.
    respect, bro.

  • @dieunest-fleur5325
    @dieunest-fleur5325 Před 4 lety +75

    You're doing a amazing job helping beginners like me try my hands at Python and see visual, tangible results. Thanks for that!

  • @stopmotionmaker9200
    @stopmotionmaker9200 Před 4 lety +21

    Through this tutorial, I went from knowing nothing to being able to do fun & cool patterns. Great video. Thanks!

  • @halcyondays4922
    @halcyondays4922 Před 3 lety +16

    THANK you. You are officially saving my coding grades right now man.

  • @renomado8616
    @renomado8616 Před 5 lety +19

    Some script i have made:
    import turtle
    n = 10
    d = [360/n, n]
    a = turtle.Turtle()
    for i in range(d[1]):
    a.left(d[0])
    a.forward(5)
    turtle.done()
    It will draw a polygon of "n" sides
    N = 10 -> decagon

    • @sophiahuang7388
      @sophiahuang7388 Před 3 lety

      Noice

    • @nosigame
      @nosigame Před 2 lety +2

      import turtle
      a = 50
      turtle.circle(a)
      turtle.done()
      work smarter not hard

  • @zaramomadi5569
    @zaramomadi5569 Před 4 lety +45

    20:14 I just love how you're making this at 2:30AM

    • @SahajOberoi
      @SahajOberoi Před 4 lety +3

      I make videos at 4-5AM in the morning (before sleeping) Waiting eagerly to get such appreciation for my videos :P

    • @_9qr
      @_9qr Před 2 lety

      @@SahajOberoi nah

  • @HorstChristophSchreiber
    @HorstChristophSchreiber Před 3 lety +14

    18:30 The turtle language has a repeat command (maybe not in python). If you use the for-loop, you should write "for _ in range(100):", because you don't need the variable (i).

    • @reidafesta9131
      @reidafesta9131 Před 11 měsíci +1

      for _ in range(x) uses an already declared variable _ which contains the return of an interactive python session. Using a discard as a variable is not a good approach and can lead to misinformation being outputted in python. Declaring a variable on a for loop is not that big of a deal and will not save you any time nor space. A for loop will always create a variable for an iteration. That is just logic.

  • @girlintheyellowdresscrafts7197

    Thank you for showing us what a newbie would do, then for showing us how it can be done to save time and typing, or in other words, the proper way to do the coding. You are the best teacher!

  • @jamesstahler
    @jamesstahler Před rokem +3

    Thanks, man. I think you did a better job of explaining it than my instructor did.

  • @chrissellings4459
    @chrissellings4459 Před 6 lety +12

    Thanks Keith, this helped me out so much. You have such a good way of explaining things without them being over complicated. In fact I think I might show this to my students when I teach it! :)

    • @KeithGalli
      @KeithGalli  Před 6 lety +6

      Glad you enjoyed the video and thank you for the kind words! Comments like this keep me motivated to keep making more videos :)

  • @jerichofischer7685
    @jerichofischer7685 Před 3 lety +1

    It's 8:52pm, my intro to programming final is due soon. Thank you for this, you're a life saver

  • @FelixAVargasA
    @FelixAVargasA Před 4 lety +8

    At the begining, when I see the tittle of this video I said oh beatiful he will draw a turtle that I looking to draw using Python...but not :). Great video and you are a great teacher man .

  • @manav9518
    @manav9518 Před 3 lety +1

    This video is too much useful and informative.🔥🔥🔥🔥
    2 min silence for those who are searching for turtle module but can't find this video.😅😅

  • @JohnSmith-kd6ip
    @JohnSmith-kd6ip Před 3 měsíci

    I didn't know of Turtle until today. This is my first tutorial on this (I am also new to Python, but used other languages before). It looks like a fun module. After a minute or two I tried it myself and created a small loop for a right angle spiral. Easy as pie. Turtle looks like something you can get kids into coding with.
    length = 10
    while length

  • @acemusiq900
    @acemusiq900 Před 4 lety +5

    Bro great tutorial I am new to python but after learning the turtle I have a way better understanding of python thanks!!!!!!

    • @KeithGalli
      @KeithGalli  Před 4 lety

      Love to hear that!! You're very welcome :)

  • @raghuramireddykommerla6387

    Perfect prog for diagram showed in video. Thanks for the turtorial.
    import turtle
    d=turtle.Turtle()
    d.speed(20)
    d.color("red", "yellow")
    d.begin_fill()
    for i in range(36):
    d.forward(300)
    d.left(170)
    d.end_fill()

  • @ashishjoshi911
    @ashishjoshi911 Před rokem

    bro is a straightforward best tuitor

  • @Pythagoras31415
    @Pythagoras31415 Před rokem

    The video is exactly what I am looking for. I am new to Python. I studied math in college and graduated back in 2005. I didn't use math professionally. I was reluctant to learning Python. I took C Programming and this language seems more suited for me.

  • @andrewwallo
    @andrewwallo Před 2 lety +1

    for anyone wondering for the flower, use this:
    for i in range(36):
    bob.forward(300)
    bob.left(170)

  • @andrewwallo
    @andrewwallo Před 2 lety +1

    This one is pretty good for the flower too!!
    from turtle import *
    color('blue', 'cyan')
    speed(10)
    begin_fill()
    while True:
    forward(200)
    left(170)
    if abs(pos()) < 1:
    break
    end_fill()
    done()

  • @vladimirfol1
    @vladimirfol1 Před 3 lety

    Finally I have a perfect video to send to people who ask me how to start programming. For fun.
    You should include the section how to install the package lol

  • @povsurealism1312
    @povsurealism1312 Před 5 lety +1

    yo thanks mate
    you just helped me get a few credits for the university
    may god bless you, and keep up THE GOOD WORK

  • @spiritedaway99
    @spiritedaway99 Před 5 lety +6

    thank youu ure a good teacher ! loved the way u think nd how u knew the cause of the errors especially in the last graph 😍 ..keep it up ❤

  • @ashishjoshi911
    @ashishjoshi911 Před rokem

    the last one took me whole day to figure out what tf was going inside in the function
    daymmnnn it is really a advance code!

  • @creativecarveciteclimb5684

    Thanks for the help, I was trying to graph something using turtle and this video helped a lot.

  • @vixlu1912
    @vixlu1912 Před 6 lety +3

    Thanks Keith, Literally have an exam on python tomorrow this helped me a lot

    • @KeithGalli
      @KeithGalli  Před 6 lety +2

      Glad to hear it! Hope you did well on your exam :)

    • @vixlu1912
      @vixlu1912 Před 6 lety +5

      Yeah I passed with a breeze cheers man :)

  • @stevemcgowan3841
    @stevemcgowan3841 Před 3 lety +2

    Thank you Keith, you are a wonderful instructor! Very clear and precise.

  • @colinhammerton6670
    @colinhammerton6670 Před 3 lety +1

    Excellent stuff! Really easy to understand without all the 'technical' jargon. I now feel like I can do this Pythonning thing, yippeeee!!!!

  • @grimindyt
    @grimindyt Před 3 lety +2

    Keith brother love from India . You are giving a lot of value in this video . But bro i want to request you to just increase volume because its little bit difficult to hear you . Have a great day man .

  • @Me-mn3kg
    @Me-mn3kg Před 4 lety +2

    Hey @Keith Galli! I recently found out your channel. I'm new at python and your videos are so helpful. Thanks a lot!

  • @zandovic
    @zandovic Před 5 lety +16

    Thanks for the tutorial! Who needs uni when you have the internet?
    Even made a moving clock with Turtle:
    import turtle
    kaese = turtle.Turtle()
    kaese.speed(10)
    h = 0
    running = True
    # draws the circle
    of the clock
    kaese.color("black")
    kaese.setheading(180)
    kaese.penup()
    kaese.forward(210)
    kaese.right(90)
    kaese.pendown()
    for i in range(90):
    kaese.forward(15)
    kaese.right(4)
    # jumps back
    to the center
    kaese.penup()
    kaese.setheading(0)
    kaese.forward(210)
    kaese.pendown()
    # draws the rotating arm
    while running:
    kaese.color("black")
    kaese.setheading(h)
    kaese.forward(200)
    kaese.color("white")
    kaese.left(180)
    kaese.forward(200)
    h -= 3.1
    turtle.done()

    • @theboringprogrammer4444
      @theboringprogrammer4444 Před 4 lety

      Wow that's actually impressing!

    • @hunyuan8045
      @hunyuan8045 Před 4 lety +2

      Speed 0 is faster than 10

    • @Voronza
      @Voronza Před 4 lety

      That's a good one. If you want to make it even cooler:
      - align main clock circle with rotating arm: they are offcenter;
      - use write function to place numbers;
      - make an animation of an actually rotating arm;

  • @oaywang3053
    @oaywang3053 Před 4 lety

    Nice! to draw that flower, I just typed forward(100) right(160) ahead (100)... a hundred times before remembering to use copy and paste!!! NICE VIDEO!

  • @brettknoss486
    @brettknoss486 Před 4 lety +1

    Cyan Magenta and Yellow are primary colours using additive theory, Blue, Red and Green for subtractive. So cyan and magenta are to be expected.

  • @leopillay8939
    @leopillay8939 Před 4 lety +1

    I'm looking forward to more videos like this ,appreciate this videos

  • @mozammelhaqmishuk
    @mozammelhaqmishuk Před 6 lety +16

    Amazing Python tutorial!

  • @yasirjune69
    @yasirjune69 Před 5 lety +2

    THANKS A LOT buddy.. all i needed i found in one video..thanks again

  • @ballholster4816
    @ballholster4816 Před 3 lety

    hey i just wanted to say thank you i watched this last year to make games and now i have a career i make games using python c# and other things like that i really wanna thank you for all that you have done

  • @jellyteeth656
    @jellyteeth656 Před 4 lety +1

    Bro you just saved me, I want to thank you personally

  • @stae24
    @stae24 Před 5 lety +10

    Alright guys, I made this script to help yall make squares:
    def square(turt, length, doFill = False):
    if doFill:
    turt.begin_fill()
    for i in range(4):
    turt.forward(length)
    turt.left(90)
    turt.end_fill()
    else:
    for i in range(4):
    turt.forward(length)
    turt.left(90)
    All you have to do is do square({turtle}, {length}, {fill: True/False})
    For example I could do this and it makes a square with a length of 100 that fills:
    bob = turtle.Turtle ()
    square(bob, 100, True)
    Setting the fill to "True" fills and settings it to "False" doesn't fill (CASE SENSITIVE!). Also, not setting the fill just turns it off by default.

    • @stae24
      @stae24 Před 5 lety

      And remember to put the def before you call the square or it won't work

    • @loltool5513
      @loltool5513 Před 5 lety

      @@stae24 ?

  • @KhalidOlatunji-cr8cx
    @KhalidOlatunji-cr8cx Před rokem +1

    The turtle grid system is x = -675 ---> 675, y = -345 ---> 345

  • @russellrobertson6911
    @russellrobertson6911 Před 4 lety +6

    i made a hexigon

  • @DHRUM1L
    @DHRUM1L Před 2 lety

    Hey Keith it was my first time using python to create something and your tutorial just helped me a lot
    Thanks for the video
    Subscribed

  • @Leopardhound
    @Leopardhound Před 2 lety

    thank you, i really like the video and how you explained the concepts. I found it easy to understand and most of all fun. I liked how you told us to give a try at some shapes so that we could try to figure out oursleves how it works! Great video liked and subscribed

  • @reaper_ballz
    @reaper_ballz Před rokem +1

    This guy is more comedic that he is informative.

  • @thecastiel69
    @thecastiel69 Před 3 lety +16

    MSW Logo in Python

  • @mayankmaurya1559
    @mayankmaurya1559 Před 2 lety

    Nice explanation
    This makes a python more creative and intresting

  • @DanKind
    @DanKind Před 5 lety +7

    for i in range(2000000):
    x.forward(math.sqrt(i)/5)
    x.left(i%185.273567834657834658734876578)

    • @Voronza
      @Voronza Před 4 lety

      @Ismail Amiri you didn't see this formula finished did ya?

    • @Voronza
      @Voronza Před 4 lety

      Nice widening spirals, becoming a space stars image. Just a kind notice to others: if you don't know how to use turtle.Screen().update() and speed(0) - don't even think to launch anything with 2M iterations.

    • @Voronza
      @Voronza Před 4 lety

      @Ismail Amiri yikes, wikipedia tells there's quite a story behind "watermelon stereotype". I don't get your joke anyway.

  • @TrangLe-dp8jf
    @TrangLe-dp8jf Před 5 lety +1

    Thank you! I have homework about drawing a triangle in Python, and the book is not helpful at all. Your video is very helpful and easy to understand

    • @Harmonity
      @Harmonity Před 5 lety +4

      Here, a fun gift:
      -=-=-=-=-=-=-=-=-=-=-
      import turtle as tu
      a = tu.Turtle()
      a.penup()
      a.goto(0, -150)
      a.pendown()
      a.left(90)
      a.speed(0)
      def drawn(l):
      if l < 5:
      return
      else:
      a.forward(l)
      a.left(30)
      drawn(4*l/5)
      a.right(60)
      drawn(4*l/5)
      a.left(30)
      a.backward(l)
      drawn(100)
      -=-=-=-=--=-=-=-=-=-=-=-
      change the ''5'' in ''if l < 5'' to change how detailed you want it (the higher, the less details, the faster it is rendered) and the ''100'' in the last line to control how many times it is going to be repeated. Pretty neat.
      Hope you enjoy it

    • @connorp2402
      @connorp2402 Před 5 lety +1

      @@Harmonity awww wowww It's a flower!!! :P

    • @connorp2402
      @connorp2402 Před 5 lety

      /Dandilion Clock!!!

  • @savitavyas1981
    @savitavyas1981 Před 3 lety

    I made a graph generator using turtle module. Thanks for the tutorial

  • @indexcards9414
    @indexcards9414 Před rokem

    This video helped out with my homework! Thanks!

  • @youthought2975
    @youthought2975 Před 3 lety +7

    for the screen part, you have to make a screen like you made pegasus. This is done by doing screen = turtle.Screen()
    then you do screen.bgcolor("red")
    Hope this helped to anyone in need :)
    (At least that's how I do it.)

  • @louiejohannesen9810
    @louiejohannesen9810 Před 5 lety

    i made this yesterday, thought i would share
    import turtle as t
    t.speed(0)
    t.pensize(1)
    x = 200 # size of circle
    y = 25 # agle of separation
    z = 36 # number of loops completed
    for i in range(z):
    t.right(y)
    t.color("red")
    t.circle(x)
    t.rt(y)
    t.color("blue")
    t.circle(x)

  • @groovinprops9716
    @groovinprops9716 Před 5 lety +4

    I got this from my computer teacher to watch the first 15 minutes of this video.

  • @aldrinsaurovsarker5159

    18:00 just use
    for i in range(10):
    keith.forward(100)
    keith.left(135)
    keith.forward(100)

  • @ProGamer-jy3gb
    @ProGamer-jy3gb Před 5 lety

    thank you alot , this helped so much... i didnt know anything about this until now

  • @gigachad9336
    @gigachad9336 Před 3 lety

    eyyy thanks man :D i already learn some python so it was easy to do the "for loops " and something

  • @nurunnahar4243
    @nurunnahar4243 Před 4 lety +41

    Look at the back of him "MIT"

  • @reubengriffin7738
    @reubengriffin7738 Před 5 lety +1

    amazing helped me so much as i am a novice at python

  • @cyrusalexander950
    @cyrusalexander950 Před 2 lety +1

    Try this one:
    import turtle
    window = turtle.Screen()
    drawer = turtle.Turtle()
    window.title("Drawing")
    window.bgcolor("white")
    counter = 110
    while True:
    drawer.forward(counter)
    drawer.left(150)
    drawer.forward(counter)
    drawer.left(165)
    counter = counter + (counter/(counter/3))
    turtle.done()

  • @Crazysvg
    @Crazysvg Před 4 lety +1

    for the screen you can do wn = turtle.Screen() then you can do wn.bgcolor("red")

  • @shlomokarsenti2617
    @shlomokarsenti2617 Před 3 lety +3

    Thanks! My teacher thinks Im a pro now

  • @mabelparra6873
    @mabelparra6873 Před 5 lety

    you could do this
    line = 0
    bob.color("red","orange")
    bob.begin_fill()
    while line < 20:
    bob.left
    (170)
    bob.forward(200)
    line += 1
    bob.end_fill()

  • @theonlydhruv7888
    @theonlydhruv7888 Před 2 lety +1

    if you change the range to 120 then the fill will go properly... you can also use turtle.pencolor('red') then turtle.fillcolor('yellow')
    if keith's commands do not work for color.

  • @Sanju-mo6in
    @Sanju-mo6in Před 3 lety +14

    23:35, he created Corona virus 2 years back!

  • @soybeanz8582
    @soybeanz8582 Před 4 lety

    keith i made all of them and its so cool!!!! thanks keith!

  • @sefabockun141
    @sefabockun141 Před 5 lety +15

    my_turtle.color("red", "yellow")
    my_turtle.speed(10)
    my_turtle.begin_fill()
    for i in range(100):
    my_turtle.forward(i**2)
    my_turtle.left(170)
    my_turtle.end_fill()
    you should try this

    • @nykolous9830
      @nykolous9830 Před 5 lety +3

      For the people that don't remember the beginning and end:
      import turtle
      my_turtle = turtle.Turtle()
      my_turtle.color("red", "yellow")
      my_turtle.speed(10)
      my_turtle.begin_fill()
      for i in range(100):
      my_turtle.forward(i**2)
      my_turtle.left(170)
      my_turtle.end_fill()
      turtle.done()

    • @hunyuan8045
      @hunyuan8045 Před 4 lety +3

      u can use "fd" instead of forward, and speed 0 is faster than 10.

    • @Sam-wg1hc
      @Sam-wg1hc Před 4 lety

      @@hunyuan8045 you can use speed 100 as well

    • @Voronza
      @Voronza Před 4 lety

      That's a nice spiral star! Though I replaced i**2 with i**2/10 for it to fit into my screen. Also, people are right about speed. Though in order to have an instant image one does just use screen update lock and update on demand.

    • @jameshuang1229
      @jameshuang1229 Před 4 lety

      @@nykolous9830 yes i did that to u just roasted that other guy
      and thats not all u have to do my_turtle = turtle.Pen()

  • @chubz1568
    @chubz1568 Před 2 lety +1

    hey Keith G I saw the mit poster in the background and was wondering what standards I need to set to get in from the UK so that I can begin working on this goal from a relatively young age.

  • @arunkumar-ct1xl
    @arunkumar-ct1xl Před 4 lety

    this the best python turtle video i ever watched.You are the best!!!! :)

  • @zacheancheta7730
    @zacheancheta7730 Před 3 lety

    for i in range(8):
    for i in range(8):
    bob.forward(90)
    bob.left(45)
    bob.penup()
    bob.left(135)
    bob.forward(90)
    bob.pendown()

  • @chamathdesilva8481
    @chamathdesilva8481 Před 5 lety +1

    Earned yourself another subsciber and like :) Keep up the great work!

    • @KeithGalli
      @KeithGalli  Před 5 lety

      Thank you!! :)

    • @chamathdesilva8481
      @chamathdesilva8481 Před 5 lety

      @@KeithGalli I was wondering, is it possible to make a 2 player chess game using turtle? I have a project on it and would love to know asap.

    • @KeithGalli
      @KeithGalli  Před 5 lety

      I would recommend using pygame instead. I have videos on connect 4 in pygame that would probably be helpful to watch

    • @chamathdesilva8481
      @chamathdesilva8481 Před 5 lety

      @@KeithGalli Thanks alot! Il do that

  • @sivakumarselvaraj5596
    @sivakumarselvaraj5596 Před 4 lety +2

    Which idle u are using

  • @jimmypalmer1451
    @jimmypalmer1451 Před 4 lety

    Awesome video man! Thanks for the information.

  • @malekabdo6088
    @malekabdo6088 Před 3 lety

    you can fill the star by just make for I in range(9): just

  • @piexiii6585
    @piexiii6585 Před 5 lety +3

    Instead of writing...
    import turtle
    keith = turtle.Turtle()
    ... you can write
    import turtle as keith
    I think it’s going to work ;)

    • @leo848
      @leo848 Před 4 lety

      Pie XIII No it must be
      import turtle
      import turtle.Turtle() as keith

  • @Zackemcee1
    @Zackemcee1 Před 4 lety

    30:36
    I found that you take 216 - 180 which equals to 36 and you take that and subtract it from 180 thus you have a 144 which is a perfect angle in order to maintain the direction and not go the other way around

  • @rolim22
    @rolim22 Před 3 lety +1

    Great video. The question is: How to have the second screen displaying the visual outcome of the code? (the Python Turtle Graphic)

    • @abigailc6271
      @abigailc6271 Před 3 lety

      same here. i wish to know too!

    • @kratospidey
      @kratospidey Před 3 lety

      @@abigailc6271 i am not sure exactly what the question is but if u want to know how to get the screen where you can see the program itself drawing, u just run the program, i am not sure which ide or text editor ur using but just google "how to run a python program in (ide / text editor name) and just running it should bring up the screen

  • @mattstirling6317
    @mattstirling6317 Před 6 lety +44

    20:11 "you're waking up in 5 hours."

  • @shwethamachani2093
    @shwethamachani2093 Před 6 lety +4

    Hey dude,
    It's very interesting topic..You explained it so neat.😊

  • @johankaruyan5536
    @johankaruyan5536 Před 4 lety

    Thanks Bob Your Such A Great Teacher!

  • @scottb4029
    @scottb4029 Před 3 lety +2

    Hey Keith, love your videos, I have watched your tkinter video, and it was excellent. I want to ask you a question about programming. About 100 years ago when I was a teenager, I learned a language called BASIC. I got pretty good at it. After that , life happened and almost 40 years passed. Now I am a disabled and at home. To keep me from getting too bored I decided to learn and realized that I wanted to build an app. I know pythons scalability make it perfect for what I want to do. My question is, where should I start to get my brain out of the command line programming.? I have watched a few object oriented tutorials but I am struggling with the main loop idea and assigning functions and syntax. Thank you for your time.

  • @darek4488
    @darek4488 Před 4 lety

    Guys, you need to check this out. This script wanders across the whole screen and covers it with random doodles just like a child would.
    I found these angles just by experimenting.
    import turtle
    import math
    bob = turtle.Turtle()
    while(1):
    bob.speed(15)
    bob.forward(20)
    print(10*math.sin(1/bob.pos()[0]+bob.pos()[1]))
    bob.left(angle)
    bob.forward(20)
    bob.right(23)
    turtle.done()

  • @eshetatayal6788
    @eshetatayal6788 Před 3 lety

    thanks for giving something to start

  • @johnathanpieters2479
    @johnathanpieters2479 Před 3 lety +1

    you know when getting it right to draw a simple shape for the first time it feels awesome and then you get professional at it and when someone else gets it right the first time your whats the big deal you drew a sqaure😅

  • @lakshyamethwani8399
    @lakshyamethwani8399 Před 4 lety

    Thanks! It helped me a lot. Specially for star tutorial :)

  • @brickgang6985
    @brickgang6985 Před 2 lety

    Instead of doing bob = turtle.Turtle() while you import you can do import turtle as bob and then you can do bob.forward(10) or something like that this helps me simplify my code

  • @namanvohra8262
    @namanvohra8262 Před 5 lety +1

    Nice video man! Really Needed this tutorial. Can classes be implemented as well?

  • @CyotieonpawZ
    @CyotieonpawZ Před 5 lety +3

    For i in range (2000)
    turtle.left(i%180)
    turtle.forward(i%180)

    • @ValleyOfWillows
      @ValleyOfWillows Před 4 lety

      A variation on your code that plays around with the coloring:
      import turtle
      turtle.colormode(255)
      turtle.speed(0)
      for i in range (2000):
      turtle.pencolor((i%180+50,0,0))
      turtle.left(i%180)
      turtle.forward(i%180)

    • @Voronza
      @Voronza Před 4 lety

      That's quite cool. Like a virus through a microscope.

  • @roryengland1996
    @roryengland1996 Před 3 lety

    learned loads, thank you very much

  • @RiKM0078
    @RiKM0078 Před 6 měsíci

    thanks for the tutorial man you are best 🤞🤞🤞🤞

  • @JordanMetroidManiac
    @JordanMetroidManiac Před 5 lety +6

    Heighway Dragon Curve (I got the bitwise math from Wikipedia on this fractal):
    for i in range (6000):
    my_turtle.forward (1)
    my_turtle.left (90 if ((i&-i)

    • @darek4488
      @darek4488 Před 4 lety

      That's quite cool, but it leaves the screen and never comes back

    • @hunyuan8045
      @hunyuan8045 Před 4 lety +1

      @@darek4488 what

  • @jwstswcks
    @jwstswcks Před 5 měsíci

    swear i saw bro getting hypnotized by the rythmic smooth movements of the lines going up down left up down left....up.....downn.......leeeffftt mmmmm.

  • @shamanthrajreddy1230
    @shamanthrajreddy1230 Před rokem

    Great tutorial, Thanks!

  • @conghieu4524
    @conghieu4524 Před 3 lety

    today I learned, thank you.

  • @kylieying2
    @kylieying2 Před 6 lety +1

    Amazing Python tutorial! My code works!

  • @mohamedismail685
    @mohamedismail685 Před 5 lety +6

    i got that error:- Traceback (most recent call last):
    File "C:\Users\Som3a\Desktop\jh.py", line 1, in
    import turtle
    File "C:\Users\Som3a\Desktop\turtle.py", line 1, in
    som3a=turtle.Turtle()
    NameError: name 'turtle' is not defined

    • @satishsharma2245
      @satishsharma2245 Před 5 lety +3

      Just import turtle

    • @ramiralcantara1731
      @ramiralcantara1731 Před 5 lety +4

      You need to make sure to didn't save the file as turtle.py. You've called a script turtle.py, which is shadowing the turtle module in the standard library. Rename it.

    • @dhruvtomar3169
      @dhruvtomar3169 Před 5 lety

      @@ramiralcantara1731 How do i rename it though??

    • @danielnjama1470
      @danielnjama1470 Před 4 lety

      @@ramiralcantara1731 I almost gave up on this, thanks for your insight

  • @citizen4602
    @citizen4602 Před 2 lety

    Thanks this video was very helpful.

  • @axelgraham6928
    @axelgraham6928 Před 4 lety +2

    Im very happy with this:
    import math
    import turtle
    t = turtle.Pen()
    t.speed(12)
    t.color("blue")
    for x in range(4000):
    t.forward(30)
    t.left(math.sin(x/13)*25)
    t.forward(math.sqrt(188))
    t.left(33)
    turtle.done()

  • @radiogagaart8157
    @radiogagaart8157 Před 4 lety +8

    I did this for a uni assignment and called the turtle "Lord Tywin", I lost marks