{"id":2570,"date":"2022-01-30T22:51:54","date_gmt":"2022-01-30T17:21:54","guid":{"rendered":"https:\/\/cbsepython.in\/?p=2570"},"modified":"2022-01-30T22:51:54","modified_gmt":"2022-01-30T17:21:54","slug":"how-to-draw-indian-flag-using-turtle-python-program","status":"publish","type":"post","link":"https:\/\/cbsepython.in\/how-to-draw-indian-flag-using-turtle-python-program\/","title":{"rendered":"How to draw Indian Flag Using Turtle Python Program"},"content":{"rendered":"<h2>How to draw Indian Flag Using Turtle Python Program<\/h2>\n<p>&nbsp;<\/p>\n<p>Source Code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import turtle\r\nfrom turtle import*\r\n\r\n#for output screen\r\nscreen = turtle.Screen()\r\n\r\n# Defining a turtle Instance\r\nt = turtle.Turtle()\r\nspeed(-2)\r\n\r\n# initially penup()\r\nt.penup()\r\nt.goto(-400, 250)\r\nt.pendown()\r\n\r\n# Orange Rectangle\r\n#white rectangle\r\nt.color(\"orange\")\r\nt.begin_fill()\r\nt.forward(800)\r\nt.right(90)\r\nt.forward(167)\r\nt.right(90)\r\nt.forward(800)\r\nt.end_fill()\r\nt.left(90)\r\nt.forward(167)\r\n\r\n# Green Rectangle\r\nt.color(\"green\")\r\nt.begin_fill()\r\nt.forward(167)\r\nt.left(90)\r\nt.forward(800)\r\nt.left(90)\r\nt.forward(167)\r\nt.end_fill()\r\n\r\n# Big Blue Circle\r\nt.penup()\r\nt.goto(70, 0)\r\nt.pendown()\r\nt.color(\"navy\")\r\nt.begin_fill()\r\nt.circle(70)\r\nt.end_fill()\r\n\r\n# Big White Circle\r\nt.penup()\r\nt.goto(60, 0)\r\nt.pendown()\r\nt.color(\"white\")\r\nt.begin_fill()\r\nt.circle(60)\r\nt.end_fill()\r\n\r\n# Mini Blue Circles\r\nt.penup()\r\nt.goto(-57, -8)\r\nt.pendown()\r\nt.color(\"navy\")\r\nfor i in range(24):\r\n    t.begin_fill()\r\n    t.circle(3)\r\n    t.end_fill()\r\n    t.penup()\r\n    t.forward(15)\r\n    t.right(15)\r\n    t.pendown()\r\n    \r\n# Small Blue Circle\r\nt.penup()\r\nt.goto(20, 0)\r\nt.pendown()\r\nt.begin_fill()\r\nt.circle(20)\r\nt.end_fill()\r\n# Spokes\r\nt.penup()\r\nt.goto(0, 0)\r\nt.pendown()\r\nt.pensize(2)\r\nfor i in range(24):\r\n    t.forward(60)\r\n    t.backward(60)\r\n    t.left(15)\r\n    \r\n#\r\nturtle.done()\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Output:<\/p>\n<div style=\"width: 860px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-2570-1\" width=\"860\" height=\"484\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2022\/01\/tricolor.mp4?_=1\" \/><a href=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2022\/01\/tricolor.mp4\">https:\/\/cbsepython.in\/wp-content\/uploads\/2022\/01\/tricolor.mp4<\/a><\/video><\/div>\n","protected":false},"excerpt":{"rendered":"<p>How to draw Indian Flag Using Turtle Python Program &nbsp; Source Code: import turtle from turtle import* #for output screen screen = turtle.Screen() # Defining a turtle Instance t = turtle.Turtle() speed(-2) # initially penup() t.penup() t.goto(-400, 250) t.pendown() # Orange Rectangle #white rectangle t.color(&#8220;orange&#8221;) t.begin_fill() t.forward(800) t.right(90) t.forward(167) t.right(90) t.forward(800) t.end_fill() t.left(90) t.forward(167) # [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-2570","post","type-post","status-publish","format-standard","hentry","category-python-projects"],"_links":{"self":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/2570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/comments?post=2570"}],"version-history":[{"count":0,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/2570\/revisions"}],"wp:attachment":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/media?parent=2570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/categories?post=2570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/tags?post=2570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}