Loading..

ব্লগ

রিসেট

২৮ অক্টোবর, ২০২৩ ১০:৩০ অপরাহ্ণ

How to Draw Denmark Flag by Python Coding
import turtle
tom = turtle.Turtle()

tom.penup()
tom.backward(250)
tom.pendown()

width = 400
height = 200

tom.fillcolor("red")
tom.begin_fill()

for i in range(2):
  tom.forward(width)
  tom.left(90)
  tom.forward(height)
  tom.left(90)
tom.end_fill()
tom.forward(150)
tom.fillcolor("white")
tom.begin_fill()

for i in range(2):
  tom.forward(50)
  tom.left(90)
  tom.forward(height)
  tom.left(90)
tom.end_fill()
tom.backward(150)
tom.left(90)
tom.forward(100)
tom.right(90)

tom.fillcolor("white")
tom.begin_fill()
for i in range(2):
  tom.forward(width)
  tom.left(90)
  tom.forward(50)
  tom.left(90)
tom.end_fill()
মন্তব্য করুন

ব্লগ