Python Tutorial in Tamil | Drawing using Turtle Module - Part 1

Описание к видео Python Tutorial in Tamil | Drawing using Turtle Module - Part 1

Welcome to JAYA Thamizh Paadam | Python Tutorial in Tamil | Drawing using Turtle Module - Part 1

print("Welcome to JAYA Thamizh Paadam - Python Tutorial - Drawing using Turtle Module - Part 1")

#######################
Program Listing...
#######################

import turtle
t1 = turtle.Turtle()
t1.color("red","yellow")

def drawsquare(tr,l):
for x in range(4):
tr.forward(l)
tr.right(90)

def drawstar(tr,l):
for x in range(5):
tr.forward(l)
tr.right(144)


t1.begin_fill()
while True:
t1.forward(200)
t1.right(170)
if abs(t1.pos())[1: # Replace [ with lesser then symbol as Youtube does not not allow angular brackets.
break
t1.end_fill()

t1.penup()
t1.backward(150)
t1.pendown()
t1.color("green","lightgreen")
t1.begin_fill()
drawsquare(t1,100)
t1.end_fill()
t1.penup()
t1.backward(150)
t1.pendown()
t1.color("blue","cyan")
t1.begin_fill()
drawstar(t1,100)
t1.end_fill()
t1.hideturtle()
t1.getscreen().mainloop()


The above example program is for educational purposes. Please feel free to play. Cheers and Happy Programming!

Комментарии

Информация по комментариям в разработке