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

Поділитися
Вставка
  • Опубліковано 27 вер 2024
  • Follow me / keithgalli for more tech content!
    In this video I walk through the Turtle Graphics library of Python. This is a perfect video for people just starting out programming to visualize their work. If you have any questions about this video, leave a comment down below!
    Feel free to watch on 1.25x or 1.5x speed to learn faster!
    Link to Turtle Documentation:
    docs.python.or...
    Source Code for this video!
    github.com/Kei...
    First video in my Python Programming series:
    • Math & Variables in Py...
    I will be uploading tutorial videos weekly, so don't forget to SUBSCRIBE to not miss anything :)
    -------------------------
    Follow me on social media!
    Instagram | / keithgalli
    Twitter | / keithgalli
    -------------------------
    If you are curious to learn how I make my tutorials, check out this video: • How to Make a High Qua...
    *I use affiliate links on the products that I recommend. I may earn a purchase commission or a referral bonus from the usage of these links.

КОМЕНТАРІ • 686

  • @KeithGalli
    @KeithGalli  6 років тому +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 5 років тому

      Can you give me the name of program?

    • @KeithGalli
      @KeithGalli  5 років тому +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  5 років тому +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 5 років тому +2

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

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

      www.sublimetext.com/3

  • @nourgamer1098
    @nourgamer1098 3 роки тому +58

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

  • @KaosWater
    @KaosWater 4 роки тому +221

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

  • @dieunest-fleur5325
    @dieunest-fleur5325 4 роки тому +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 4 роки тому +21

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

  • @zaramomadi5569
    @zaramomadi5569 4 роки тому +45

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

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

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

    • @_9qr
      @_9qr 2 роки тому

      @@SahajOberoi nah

  • @HorstChristophSchreiber
    @HorstChristophSchreiber 3 роки тому +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 Рік тому +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
    @girlintheyellowdresscrafts7197 5 років тому +4

    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!

  • @chrissellings4459
    @chrissellings4459 6 років тому +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  6 років тому +6

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

  • @jamesstahler
    @jamesstahler Рік тому +3

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

  • @jerichofischer7685
    @jerichofischer7685 3 роки тому +1

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

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

    bro is a straightforward best tuitor

  • @acemusiq900
    @acemusiq900 4 роки тому +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  4 роки тому

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

  • @raghuramireddykommerla6387
    @raghuramireddykommerla6387 2 роки тому

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

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

    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 2 роки тому +1

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

  • @russellrobertson6911
    @russellrobertson6911 4 роки тому +7

    i made a hexigon

    • @SandyHandys
      @SandyHandys 2 місяці тому

      Very nice (borat voice)

  • @nurunnahar4243
    @nurunnahar4243 4 роки тому +41

    Look at the back of him "MIT"

  • @povsurealism1312
    @povsurealism1312 5 років тому +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 5 років тому +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 ❤

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

    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

  • @creativecarveciteclimb5684
    @creativecarveciteclimb5684 2 роки тому +1

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

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

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

  • @colinhammerton6670
    @colinhammerton6670 3 роки тому +1

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

  • @Me-mn3kg
    @Me-mn3kg 4 роки тому +2

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

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

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

  • @thecastiel69
    @thecastiel69 3 роки тому +16

    MSW Logo in Python

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

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

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

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

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

      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 4 роки тому

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

  • @stae24
    @stae24 6 років тому +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 6 років тому

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

    • @loltool5513
      @loltool5513 5 років тому

      @@stae24 ?

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

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

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

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

  • @renomado8616
    @renomado8616 5 років тому +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 3 роки тому

      Noice

    • @nosigame
      @nosigame 2 роки тому +2

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

  • @groovinprops9716
    @groovinprops9716 5 років тому +4

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

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

    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!

  • @mattstirling6317
    @mattstirling6317 6 років тому +44

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

  • @shlomokarsenti2617
    @shlomokarsenti2617 3 роки тому +3

    Thanks! My teacher thinks Im a pro now

  • @cyrusalexander950
    @cyrusalexander950 2 роки тому +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()

  • @mabelparra6873
    @mabelparra6873 5 років тому

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

  • @Leopardhound
    @Leopardhound 2 роки тому

    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

  • @DHRUM1L
    @DHRUM1L 2 роки тому

    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

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

    Which idle u are using

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

    This video helped out with my homework! Thanks!

  • @louiejohannesen9810
    @louiejohannesen9810 5 років тому

    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)

  • @mayankmaurya1559
    @mayankmaurya1559 2 роки тому

    Nice explanation
    This makes a python more creative and intresting

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

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

  • @TrangLe-dp8jf
    @TrangLe-dp8jf 5 років тому +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 5 років тому +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 5 років тому +1

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

    • @connorp2402
      @connorp2402 5 років тому

      /Dandilion Clock!!!

  • @arunkumar-ct1xl
    @arunkumar-ct1xl 4 роки тому

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

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

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

  • @ProGamer-jy3gb
    @ProGamer-jy3gb 5 років тому

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

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

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

  • @johnathanpieters2479
    @johnathanpieters2479 3 роки тому +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😅

  • @piexiii6585
    @piexiii6585 6 років тому +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 4 роки тому

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

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

    thanks for giving something to start

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

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

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

      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 4 роки тому

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

  • @radiogagaart8157
    @radiogagaart8157 4 роки тому +8

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

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

      The real question is do you regret doing it? If not then it was worth it

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

      @@captainjacksparrow3221 it was very worth it 😂

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

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

  • @RiKM0078
    @RiKM0078 6 місяців тому

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

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

    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 5 років тому +1

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

    • @KeithGalli
      @KeithGalli  5 років тому

      Thank you!! :)

    • @chamathdesilva8481
      @chamathdesilva8481 5 років тому

      @@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  5 років тому

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

    • @chamathdesilva8481
      @chamathdesilva8481 5 років тому

      @@KeithGalli Thanks alot! Il do that

  • @jwstswcks
    @jwstswcks 5 місяців тому

    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.

  • @brickgang6985
    @brickgang6985 2 роки тому

    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

  • @shamanthrajreddy1230
    @shamanthrajreddy1230 2 роки тому

    Great tutorial, Thanks!

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

    Awesome video man! Thanks for the information.

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

    learned loads, thank you very much

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

    today I learned, thank you.

  • @Bobitsaneva
    @Bobitsaneva 11 місяців тому

    I finally got it and thank you so muck

  • @citizen4602
    @citizen4602 2 роки тому

    Thanks this video was very helpful.

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

    Amazing Python tutorial! My code works!

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

    Thanks a lot for the video. Amazing Job.

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

    now i love graphics

  • @niraleemalot8032
    @niraleemalot8032 2 роки тому

    Thank for the tutorial!

  • @aronisadventures
    @aronisadventures 4 місяці тому

    thanks a lot bro so good please make more

  • @fillpattanamontri8698
    @fillpattanamontri8698 3 роки тому +1

    hurts me when you say "yay" with that energy

  • @EMSAStpaulelectoralboard
    @EMSAStpaulelectoralboard Рік тому +2

    i accidently made 2 arrows

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

    thank you so much, this was helpful

  • @scottb4029
    @scottb4029 3 роки тому +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.

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

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

  • @TheHaLeM2
    @TheHaLeM2 2 роки тому

    Great video, many thx!

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

    You can't name it 'John Cena', so then we won't be able to see the output

  •  5 років тому

    thanks amigo, this is a wonderful set of examples, hugs

  • @animeshpandey4138
    @animeshpandey4138 5 років тому

    Dope Tutorial !!! .... looking forward to more

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

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

  • @smudgepost
    @smudgepost 5 років тому

    Create a window with a fixed size = turtle.setup( width = 800, height = 800, startx = None, starty = None)

  • @bethanderson5050
    @bethanderson5050 5 років тому

    Nicely done and very helpful.

  • @ArhamKhan05
    @ArhamKhan05 2 місяці тому

    Thank You So Much Sir. Very Great and Very Beautiful Explanation Sir. Love form Pakistan ❤

  • @dailymotiv8411
    @dailymotiv8411 2 роки тому

    love you bro thanks for the video

  • @jacktech4055
    @jacktech4055 5 років тому

    Your Videos Are So Helpful Sir

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

    This is awesome and Helped me alot I appreciate it ! Thank you,,,

  • @IbrahimIbrahim-st3qw
    @IbrahimIbrahim-st3qw 2 роки тому

    great work ...
    keep it up

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

    A SIMPLE JOKE: If you give turtle name "JOHN CENA" we won't be able to see the turtle graphics after running the program..."you can't see me"-JOHN CENA
    but on serious note.Tthankyou sir..tutorials are fantastic

  • @mankaransingh2599
    @mankaransingh2599 6 років тому +5

    Try to run this for 10 mins:
    import turtle
    pointer=turtle.Turtle()
    while True:
    pointer.forward(200)
    pointer.left(160)
    pointer.forward(200)
    pointer.left(1)

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

      I did, Looks cool! :)

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

      ah, the angle was 160 not 170 xD a small mistake can spoil whole stuff
      anyways, epic video man. keep it up :)

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

      try putting 0.1 instead of 1 it is way cooler

    • @Alan_christo
      @Alan_christo 5 років тому

      getting error "multiple statements found while compiling a single statement"

    • @heyyall1297
      @heyyall1297 5 років тому

      Just try this, it is amazing bro! Thanks

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

    if you want to use RGB values if you type "turtle.colormode(255)"
    just after you initiate your turtle object you can then pass your RGB values like (255,255,255)
    he said its a lot more work its not...
    t = turtle.Turtle()
    turtle.colormode(255)
    t.color(255,255,255)

  • @rolim22
    @rolim22 3 роки тому +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 3 роки тому

      same here. i wish to know too!

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

      @@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

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

    keith galli=='gally boy'
    Apna tyme ayega !!!

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

    Thanks it was great and usefull

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

    Very good. Thanks.

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

    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 5 років тому +3

      Just import turtle

    • @ramiralcantara1731
      @ramiralcantara1731 5 років тому +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 5 років тому

      @@ramiralcantara1731 How do i rename it though??

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

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

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

    I love this video and on my language jag älskar den här videon

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

    Check this code out - Pointless, long but very satisfying
    import turtle
    arrow = turtle.Turtle()
    for i in range (1,100):
    for i in range (1,2):
    for i in range (1,38) :
    arrow.forward(150)
    arrow.left(170)
    arrow.penup()
    arrow.forward(150)
    arrow.pendown()
    turtle.done()
    please add indents accordingly

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

      Nicely done! Here's how you can make this image instant and use "Escape" button to close it:
      import turtle
      def game_exit():
      print('Escape button pushed')
      window.bye()
      turtle.onkey(game_exit, "Escape") # keys: www.tcl.tk/man/tcl8.4/TkCmd/keysyms.htm
      turtle.listen()
      window = turtle.Screen()
      window.tracer(0)
      window.title("Rio Python demo animation")
      window.bgcolor("#34D4FC")
      arrow = turtle.Turtle()
      for i in range (1,100):
      for i in range (1,2):
      for i in range (1,38) :
      arrow.forward(150)
      arrow.left(170)
      arrow.penup()
      arrow.forward(150)
      arrow.pendown()
      window.update()
      turtle.done()

  • @Dotto19
    @Dotto19 2 роки тому

    What a legend 👍🏾