MCC – Turtle

Python turtle is fun to learn, it teaches graphics in easy way. We started with basic shape and fill color as below

import turtle

turtle.color('red','yellow')

turtle.begin_fill()

turtle.forward(200)
turtle.left(90)
turtle.forward(200)
turtle.left(90)
turtle.forward(200)
turtle.left(90)
turtle.forward(200)

turtle.end_fill()

turtle.done()

Output would be

draw

we continued to add few more line of code to learn about pattern

import  turtle

turtle.speed(500)

for i in range(36):
    turtle.forward(100)

    turtle.right(20)
    turtle.forward(50)
    turtle.left(10)
    turtle.forward(50)
    turtle.left(10)

    turtle.penup()
    turtle.setposition(0,0)
    turtle.pendown()
    turtle.left(10)

turtle.done()

Output as below

pattern

as you see our coding is becoming more and more complex, but we are making progress.


Leave a comment