Learn Python Programming – 3 – The Turtle

Learn Python Programming – 3 – The Turtle


100 thoughts on “Learn Python Programming – 3 – The Turtle”

  1. import turtle
    wn = turtle.screen()
    my_turtle = turtle.Turtle()
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)

  2. import turtle
    #Make a square with the turtle.
    my_turtle=turtle.Turtle()
    my_turtle=turtle.forward(200)
    my_turtle=turtle.left(90)
    my_turtle=turtle.forward(200)
    my_turtle=turtle.left(90)
    my_turtle=turtle.forward(200)
    my_turtle=turtle.left(90)
    my_turtle=turtle.forward(200)

  3. Do you dare to run dis?

    import turtle as t

    def suorakulmio(horizontal, vertical, color):

    t.pendown()

    t.pensize(1)

    t.color(color)

    t.begin_fill()

    for counter in range(1, 3):

    t.forward(horizontal)

    t.right(90)

    t.forward(vertical)

    t.right(90)

    t.end_fill()

    t.penup()

    t.speed("fastest")

    t.bgcolor("black")

    #jalkaterät

    t.penup()

    t.goto(-100, -150)

    suorakulmio(50, 20, "blue")

    t.goto(-30, -150)

    suorakulmio(50, 20, "blue")

    #jalat

    t.goto(-25, -50)

    suorakulmio(15, 100, "grey")

    t.goto(-55, -50)

    suorakulmio(-15, 100, "grey")

    #ruumis

    t.goto(-90, 100)

    suorakulmio(100, 150, "red")

    #käsivarret

    t.goto(-150, 70)

    suorakulmio(60, 15, "grey")

    t.goto(-150, 110)

    suorakulmio(15, 40, "grey")

    t.goto(10, 70)

    suorakulmio(60, 15, "grey")

    t.goto(55, 110)

    suorakulmio(15, 40, "grey")

    #kaula

    t.goto(-50, 120)

    suorakulmio(15, 20, "grey")

    #pää

    t.goto(-85, 170)

    suorakulmio(80, 50, "red")

    #silmät

    t.goto(-60, 160)

    suorakulmio(30, 10, "white")

    t.goto(-60, 160)

    suorakulmio(5, 5, "black")

    t.goto(-45, 155)

    suorakulmio(5, 5, "black")

    t.hideturtle()

    #suu

    t.goto(-65, 135)

    t.right(5)

    suorakulmio(40, 5, "black")

  4. Hi! buddy. You have dona a great job for us(beginner's). We have no idea how to learn python in earlier time with clear instruction. But you have solved all of my prob. Thank you a lot!

  5. >>> import turtle

    >>>

    >>>

    >>>

    >>> my_turtle = turtle.Turtle()

    >>> my_turtle.forward(100)
    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.right(90)

    >>> my_turtle.forward(50)

    >>> my_turtle.right(90)

    >>> my_turtle.forward(150)

    >>> my_turtle.right(90)

    >>> my_turtle.forward(200)

    >>> my_turtle.right(90)

    >>> my_turtle.forward(150)

    >>> my_turtle.right(90)

    >>> my_turtle.forward(50)

    >>> my_turtle.right(45)

    >>> my_turtle.forward(141)

    >>> my_turtle.right(180)

    >>> my_turtle.forward(70.5)>>> my_turtle.left(90)

    >>> my_turtle.forward(70.5)

    >>> my_turtle.right(180)

    >>> my_turtle.forward(141)

    >>> my_turtle.right(45)

    >>> my_turtle.forward(50)

    >>> my_turtle.right(135)

    >>> my_turtle.forward(70)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(70)

    >>> my_turtle.right(90)

    >>> my_turtle.forward(70)

    >>> my_turtle.right(90)

    >>> my_turtle.forward(70)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(70)

    >>> my_turtle.right(90)

    >>> my_turtle.forward(70)

    >>> my_turtle.right(90)

    >>> my_turtle.forward(70)

    >>> my_turtle.right(90)

    >>> my_turtle.right(180)

    >>> my_turtle.forward(70)

    >>> my_turtle.right(135)

    >>> my_turtle.forward(50)

    >>>

  6. Traceback (most recent call last):

    File "E:mineDocumentspython exerciseturtle.py", line 1, in <module>

    import turtle

    File "E:mineDocumentspython exerciseturtle.py", line 2, in <module>

    my_turtle = turtle.Turtle()

    AttributeError: module 'turtle' has no attribute 'Turtle'

    import turtle

    my_turtle = turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

  7. hi there i made hexagon
    import turtle

    my_turtle = turtle.Turtle()

    my_turtle.forward(60)

    my_turtle.left(60)

    my_turtle.forward(60)

    my_turtle.left(60)

    my_turtle.forward(60)

    my_turtle.left(60)

    my_turtle.forward(60)

    my_turtle.left(60)

    my_turtle.forward(60)

    my_turtle.left(60)

    my_turtle.forward(60)

  8. import turtle

    my_turtle = turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

  9. I have a question. How fast can one learn this and get a job? I need the money to buy my parents house before they sell it. The house has immense sentimental value to me.

    import turtle

    while True:
    Line = turtle.Turtle()

    Line.forward(100)
    Line.left(90)
    Line.forward(100)
    Line.left(90)
    Line.forward(100)
    Line.left(90)
    Line.forward(100)

  10. my_turtle = turtle.Turtle ()
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)

  11. >>> my_turtle.reset()
    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

  12. LOL; I did this basic computer programming back in 1987, in my 3rd grade computer class once a week. I remember how huge the apple machines were then, and how I thought, "this is boring and complicated, why should I learn this? We won't need this shit when we're older!"… Well, fast forward to 2018, and I find out college courses (CISC) are actually still teaching this!… WHY????

  13. >>> import turtle

    >>>

    >>>

    >>>

    >>> my_turtle = turtle.Turtle()

    >>> my_turtle.forward(100)

    >>> my_turtle.forward(100)

    >>>

    >>>

    >>>

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>>

  14. import turtle

    t=painter1=turtle.Turtle()

    pencolor=input("#FF4500")

    t.color(pen_color,fill_color)

    t.begin_fill()

    for_inrange(3);

    t.forward(200)

    t.right(90)

    t.forward(25)

    t.right(90)

    t.forward(200)

    t.right(90)

    t.forward(25)

    t.right(180)

    t.forward(25)

    t.end_fill()

    it is not working .if any correction in a program???? @Rafeh Qazi @clever programmer

  15. Hi. Thank you for the tutorials. Do you still have the coding exercises available? I tried to click on the link, but it was a broken link

  16. .

    >>> import turtle

    >>> my_turtle = turtle.Turtle()

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

  17. Hi Rafeh!

    Really like your style! Have been doing statistical analysis in R and your videos help me to take the next step: Python, really like it 🙂 And omg… I only found out after the next video… In the tutorial I thought the exercise was: draw a SQUID instead of a square :'D. I was already thinking: wow you're really trying to get people to be creative… So.. Thanks to your help, I actually did make a Squid : https://github.com/lotwij/DrawingASquid

    Thank you again for the videos/course 🙂

  18. import turtle

    my_turtle = turtle.Turtle()
    my_turtle.forward(100)
    my_turtle.right(90)
    my_turtle.forward(100)
    my_turtle.right(90)
    my_turtle.forward(100)
    my_turtle.right(90)
    my_turtle.forward(100)

  19. my_turtle = turtle.Turtle()

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(99)

  20. my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)

  21. Mohammad Shahadat Hossain

    lets work with turtle, it is fun.

    Traceback (most recent call last):

    File "C:/Users/Wahida Akter/AppData/Local/Programs/Python/Python37-32/hye hye.py", line 4, in <module>

    import turtle

    File "C:/Users/Wahida Akter/AppData/Local/Programs/Python/Python37-32turtle.py", line 1, in <module>

    my_turtle =turtle.Turtle()

    NameError: name 'turtle' is not defined
    what is the problem with this??
    facing each and every time

  22. import turtle

    my_turtle = turtle.Turtle()
    my_turtle.forward(100)
    my_turtle = turtle.Turtle()
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.right(90)
    my_turtle.forward(100)
    my_turtle.right(90)
    my_turtle.forward(100)

  23. import turtle
    my_turtle = turtle.Turtle()
    my_turtle.forward(100)
    my_turtle.right(90)
    my_turtle.backward(100)
    my_turtle.left(90)
    my_turtle.backward(100)
    my_turtle.right(90)
    my_turtle.forward(100)

  24. >>> import turtle
    >>> my_turtle = turtle.Turtle()
    >>> my_turtle.forward(100)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(100)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(100)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(100)

  25. # Make a square with the turtle.

    import turtle

    my_turtle=turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

  26. import turtle

    my_turtle=turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

  27. whats the point in naming turtle. in the line of my_turtle = turtle.Turtle()

    im guessing you are just showing us that you can name turtle? other than that is there any other reason?

  28. Okay, I know some will look at this and end saying, "Whoa!" I remember some of my Pascal programming from years ago, and thought, "Hey, why not show off the old toy Spirograph!" So, ladies and gents here's the code for that –

    import turtle

    my_turtle = turtle.Turtle()

    my_turtle.speed(0)

    def square():

    loop = 0

    while loop < 4:

    my_turtle.forward(150)

    my_turtle.left(90)

    loop += 1

    def basic_spiro():

    i = 0

    while i < 200:

    square()

    my_turtle.left(23)

    i += 1

    basic_spiro()

  29. For people who are getting this error:Traceback (most recent call last):
      File "C:/Users/Desktop/Python 3.7.1/Lessons/turtle.py", line 1, in <module>
        import turtle
      File "C:/Users/Desktop/Python 3.7.1/Lessonsturtle.py", line 3, in <module>
        my_turtle = turtle.Turtle()
    AttributeError: module 'turtle' has no attribute 'Turtle'Please note that you cannot name your file 'turtle.py' cause then when you 'import turtle' it will import the file you created and therefore will not find the attribute 'Turtle'. solution: name you file something else, other than 'turtle.py'.

  30. Hi how many of you have letter A on their name like me

    Here is A with turtle

    from turtle import *

    left(120)
    forward(100)
    left(120)
    forward(100)
    left(180)
    forward(50)
    right(60)
    forward(50)

  31. import turtle
    my_turtle = turtle.Turtle()
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)

  32. import turtle
    my_turtle=turtle.Turtle()
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)

  33. import turtlemy_turtle = turtle.Turtle()
    my_turtle.forward(200)
    my_turtle.left(90)
    my_turtle.forward(200)
    my_turtle.left(90)
    my_turtle.forward(200)
    my_turtle.left(90)
    my_turtle.forward(200)

  34. My name 🙂

    import turtle

    n = turtle.Turtle()

    n.backward(100)

    n.forward(100)

    n.right(130)

    n.forward(160)

    n.left(130)

    n.forward(100)

    n.left(70)

    n.forward(135)

    n.right(140)

    n.forward(135)

    n.backward(55)

    n.right(110)

    n.forward(58)

    n.backward(58)

    n.left(110)

    n.forward(55)

    n.left(70)

    n.forward(1)

    n.left(90)

    n.forward(130)

    n.right(160)

    n.forward(140)

    n.left(160)

    n.forward(130)

  35. >>> my_turtle = turtle.Turtle()

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    Hope fully its right

  36. Lex Loci associates

    import turtle
    my_turtle=turtle.Turtle()
    my_turtle.forward(125)
    my_turtle.left(90)
    my_turtle.forward(125)
    my_turtle.left(90)
    my_turtle.forward(125)
    my_turtle.left(90)
    my_turtle.forward(125)
    # Make a square with the turtle.
    This is what I did!!!
    IM STUDYING IN 9TH GRADE and I LOVE THE WAY YOU EXPLAIN PROGRAMMING
    THANKS A LOT!!!!!!!!!!!!!!!!!!

  37. import turtle

    # Make a square with the turtle.
    sq_Turtle=turtle.Turtle()
    sq_Turtle.forward(100)
    sq_Turtle.left(90)
    sq_Turtle.forward(100)
    sq_Turtle.left(90)
    sq_Turtle.forward(100)
    sq_Turtle.left(90)
    sq_Turtle.forward(100)
    sq_Turtle.left(90)

  38. super minecraft gamer24

    t.fd(100)
    >>> t.lt(90)
    >>> t.fd(90)
    >>> t.lt(90)
    >>> t.fd(90)
    >>> t.fd(10)
    >>> t.lt(90)
    >>> t.fd(100)
    >>> t.back(10)

  39. import turtle

    my_turtle = turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

  40. turtle = turtle.Turtle()

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

    >>> turtle.forward(100)

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

    >>> turtle.left(90)

    >>> turtle.forward(100)

  41. import turtle
    my_turtle = turtle.Turtle()
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)

  42. my_turtle = turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.right(90)

    my_turtle.forward(100)

    my_turtle.right(90)

    my_turtle.forward(100)

  43. >>> my_turtle=turtle.Turtle()

    >>> my_turtle=turtle.forward(100)

    >>> my_turtle=turtle.right(90)

    >>> my_turtle=turtle.forward(100)

    >>> my_turtle=turtle.left(90)

    >>> my_turtle=turtle.backward(100)

    >>> my_turtle=turtle.left(90)

    >>> my_turtle=turtle.forward(100)

  44. import turtle

    my_turtle = turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

  45. hi, i use atom text editor to run scripts and i tried this but the window won't stay open. help me please!!

  46. import turtle

    my_turtle = turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

  47. import turtle

    my_turtle=turtle.Turtle()

    my_turtle.forward(125)

    my_turtle.left(90)

    my_turtle.left(90)

    my_turtle.left(45)

    my_turtle.forward(176)

    my_turtle.right(135)

    my_turtle.forward(250)

    my_turtle.left(135)

    my_turtle.forward(176)

    my_turtle.left(135)

    my_turtle.forward(125)

  48. Here is my code to draw a square with turtle.
    import turtle

    my_turtle=turtle.Turtle()
    my_turtle.backward(100)
    my_turtle.right(90)
    my_turtle.backward(100)
    my_turtle.right(90)
    my_turtle.backward(100)
    my_turtle.right(90)
    my_turtle.forward(100)

  49. square:
    >>> import turtle
    >>> my_turtle = turtle.Turtle()
    >>> my_turtle.forward(100)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(100)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(100)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(100)

  50. import turtle

    >>>

    >>> my_turtle = turtle.Turtle()

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>>

  51. import turtle
    my_turtle = turtle.Turtle()

    my_turtle.fd(100)

    my_turtle.lt(90)

    my_turtle.fd(100)

    my_turtle.lt(90)

    my_turtle.fd(100)

    my_turtle.lt(90)
    my_turtle.fd(100)

  52. import turtle

    my_turtle = turtle.Turtle()

    my_turtle.forward(1080)

    my_turtle.left(90)

    my_turtle.forward(1080)

    my_turtle.left(90)

    my_turtle.forward(1080)

    my_turtle.left(90)

    my_turtle.forward(1080)

  53. import turtle
    turtle = turtle.Turtle()
    turtle.forward(100)

    turtle.left(90)

    turtle.forward(100)

    turtle.left(90)

    turtle.forward(100)

    turtle.left(90)

    turtle.forward(100)

  54. import turtle

    you_turtle = turtle.Turtle()

    you_turtle.forward(100)

    you_turtle.left(90)

    you_turtle.forward(100)

    you_turtle.right(90)

    you_turtle.forward(100)

  55. import turtle

    my_turtle = turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

  56. bro in python(3.7.3 version) it shows error like this:
    >> my_turtle.forward(125)

    Traceback (most recent call last):

    File "<pyshell#63>", line 1, in <module>

    my_turtle.forward(125)

    NameError: name 'my_turtle' is not defined

  57. >>> my turtle
    SyntaxError: invalid syntax
    >>> import turtle
    >>> my turtle = turtle.Turtle()
    SyntaxError: invalid syntax
    >>> my_turtle = turtle.Turtle()
    >>> my_turtle.forward(100)
    >>> my_turtle.left
    <bound method TNavigator.left of <turtle.Turtle object at 0x10a56fcf8>>
    >>> my_turtl.left(90)
    Traceback (most recent call last):
    File "<pyshell#16>", line 1, in <module>
    my_turtl.left(90)
    NameError: name 'my_turtl' is not defined
    >>> MY_TURTLE.LEFT(90)
    Traceback (most recent call last):
    File "<pyshell#17>", line 1, in <module>
    MY_TURTLE.LEFT(90)
    NameError: name 'MY_TURTLE' is not defined
    >>> my_turtle.left(90)
    >>> my_turtle.forward(100)
    >>> my_turtle.(left)
    SyntaxError: invalid syntax
    >>> my_turtle.left(90)
    >>> my_turtle.forward(100)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(100)
    >>>

  58. import turtle

    squareTurtle = turtle.Turtle()
    forLoopSQTurtle = turtle.Turtle()

    squareTurtle.speed = 50
    forLoopSQTurtle.speed = 20

    # straight forward example
    squareTurtle.forward(100)
    squareTurtle.left(90)
    squareTurtle.forward(50)
    squareTurtle.left(90)
    squareTurtle.forward(50)
    squareTurtle.left(90)
    squareTurtle.forward(50)
    squareTurtle.left(90)

    # Looping 4 times to create a square
    for i in range(4):
    forLoopSQTurtle.left(90)
    forLoopSQTurtle.forward(50)

    squareTurtle.right(90)
    squareTurtle.forward(50)
    squareTurtle.left(90)
    squareTurtle.forward(50)
    squareTurtle.left(90)
    squareTurtle.forward(50)
    squareTurtle.left(90)

    for i in range(4):
    forLoopSQTurtle.right(90)
    forLoopSQTurtle.forward(50)

    squareTurtle.right(180)
    squareTurtle.forward(50)
    squareTurtle.left(90)
    squareTurtle.forward(50)
    squareTurtle.left(90)
    squareTurtle.forward(50)
    squareTurtle.left(90)

    for i in range(4):
    forLoopSQTurtle.forward(50)
    forLoopSQTurtle.right(90)

    for i in range(4):
    forLoopSQTurtle.forward(50)
    forLoopSQTurtle.left(90)

    squareTurtle.forward(100)
    squareTurtle.left(90)
    squareTurtle.forward(50)
    squareTurtle.left(90)
    squareTurtle.forward(50)
    squareTurtle.left(90)

    turtle.done()

    # Make a square with the turtle.

  59. import turtle

    my_turtle = turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

  60. import turtle

    >>> my_turtle = turtle.Turtle()

    >>> my_turtle.forward(100)

    >>> my_turtle.upward(100)

    Traceback (most recent call last):

    File "<pyshell#8>", line 1, in <module>

    my_turtle.upward(100)

    AttributeError: 'Turtle' object has no attribute 'upward'

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.right(90)

    >>> my_turtle.forward(100)

    >>>

  61. copy this to get a beautiful pattern

    import turtle
    bob=turtle.Turtle
    bob.bgcolor("black")
    for i in range(42354135384135181354843513):
    for i in range(1):
    bob.pencolor("red")
    bob.forward(150)
    bob.left(75)
    for i in range(1):
    bob.pencolor("orange")
    bob.forward(120)
    bob.left(75)
    for i in range(1):
    bob.pencolor("yellow")
    bob.forward(100)
    bob.left(75)
    for i in range(1):
    bob.pencolor("green")
    bob.forward(80)
    bob.left(75)
    for i in range(1):
    bob.pencolor("blue")
    bob.forward(60)
    bob.left(75)

  62. >>> import turtle

    >>>

    >>>

    >>>

    >>> my_turtle = turtle.Turtle()

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>> my_turtle.left(90)

    >>> my_turtle.forward(100)

    >>>

  63. >>> import turtle
    >>>
    >>> my_turtle = turtle.Turtle()
    >>> my_turtle.forward(25)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.right(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.right(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(180)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.right(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(10)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(180)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(180)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(10)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.right(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.right(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.right(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(180)
    >>> my_turtle.forward(25)
    >>> my_turtle.right(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.right(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(180)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(90)
    >>> my_turtle.left(180)
    >>> my_turtle.forward(10)
    >>> my_turtle.left(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.right(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.right(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.right(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(180)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(90)
    >>> my_turtle.left(180)
    >>> my_turtle.forward(10)
    >>> my_turtle.left(180)
    >>> my_turtle.forward(10)
    >>> my_turtle.right(90)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(180)
    >>> my_turtle.forward(155)
    >>> my_turtle.forward(25)
    >>> my_turtle.left(180)
    >>> my_turtle.forward(180)
    >>>

  64. Mousa Abdelnaby Ahmed

    import turtle

    my_turtle = turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

  65. import turtle

    my_turtle = turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

  66. HEY

    import turtle

    my_turtle = turtle.Turtle()

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(180)

    my_turtle.forward(50)

    my_turtle.left(90)

    my_turtle.forward(50)

    my_turtle.left(90)

    my_turtle.forward(50)

    my_turtle.left(180)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.penup()

    my_turtle.forward(50)

    my_turtle.pendown()

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.right(90)

    my_turtle.forward(60)

    my_turtle.right(90)

    my_turtle.penup()

    my_turtle.forward(50)

    my_turtle.pendown()

    my_turtle.right(90)

    my_turtle.forward(60)

    my_turtle.left(90)

    my_turtle.forward(50)

    my_turtle.left(90)

    my_turtle.forward(60)

    my_turtle.penup()

    my_turtle.forward(50)

    my_turtle.left(90)

    my_turtle.forward(50)

    my_turtle.pendown()

    my_turtle.forward(50)

    my_turtle.right(90)

    my_turtle.penup()

    my_turtle.forward(50)

    my_turtle.pendown()

    my_turtle.right(90)

    my_turtle.forward(100)

    my_turtle.right(90)

    my_turtle.forward(50)

    my_turtle.right(90)

    my_turtle.penup()

    my_turtle.forward(50)

    my_turtle.pendown()

    my_turtle.right(90)

    my_turtle.forward(50)

  67. This is what happens when I do it? hmmm
    >>> import turtle
    >>> my_turtle = turtle.turtle()
    Traceback (most recent call last):
    File "<pyshell#7>", line 1, in <module>
    my_turtle = turtle.turtle()
    AttributeError: module 'turtle' has no attribute 'turtle'

  68. import turtle

    my_turtle=turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.right(90)

    my_turtle.forward(100)

    my_turtle.right(90)

    my_turtle.forward(100)

    my_turtle.right(90)

    my_turtle.forward(100)

  69. my_turtle = turtle.Turtle()

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    my_turtle.left(90)

    my_turtle.forward(100)

    turtle.done()

  70. If you aren't getting a pop-up window with the turtle and you are getting an error like this instead:

    ModuleNotFoundError: No module named 'tkinter'

    you need to install the following (ubuntu)
    sudo apt-get install python3-tk

  71. وردة القرنفل

    import turtle
    my_turtle=turtle.Turtle()
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)
    my_turtle.left(90)
    my_turtle.forward(100)

  72. >>> import turtle
    >>> Death = turtle.Turtle()
    >>> Death.forward(100)
    >>> Death.left(90)
    >>> Death(100)
    Traceback (most recent call last):
    File "<pyshell#10>", line 1, in <module>
    Death(100)
    TypeError: 'Turtle' object is not callable
    >>> Death.forward(100)
    >>> Death.left(90)
    >>> Death.forward(100)
    >>> Death.left(90)
    >>> Death.forward(100)
    >>> Death.left(135)
    >>> Death.forward(100)
    >>> Death.forward(50)

  73. The python turtle graphics is not showing. Its showing name error: name 'Turtle' is not defined.
    How to get that turtle graphics. Plz help

Leave a Reply

Your email address will not be published. Required fields are marked *