{"id":3525,"date":"2022-10-15T23:29:53","date_gmt":"2022-10-15T17:59:53","guid":{"rendered":"https:\/\/cbsepython.in\/?p=3525"},"modified":"2022-10-15T23:36:49","modified_gmt":"2022-10-15T18:06:49","slug":"happy-diwali-python-program-using-turtle","status":"publish","type":"post","link":"https:\/\/cbsepython.in\/happy-diwali-python-program-using-turtle\/","title":{"rendered":"Happy Diwali Python Program using Turtle"},"content":{"rendered":"<p><span style=\"color: #000000;\">Send Diwali wishes to your loving ones in cool way. Here we get a cool <strong>Happy Diwali Python Program<\/strong> using Turtle module.\u00a0<\/span><\/p>\n<h3><span style=\"color: #000000;\">Happy Diwali Python Program using Turtle<\/span><\/h3>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Source Code:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import turtle\r\n\r\n#turtle.Screen\r\nturtle.bgcolor(\"black\")\r\n\r\nturtle.up()\r\nturtle.color(\"red\")\r\nturtle.fillcolor(\"red\")\r\n\r\n# Diya\r\nturtle.setpos (-150, 100)\r\nturtle.down()\r\nturtle.right(90)\r\nturtle.begin_fill()\r\nturtle.circle(150, 180)\r\nturtle.left(90)\r\nturtle.forward (300)\r\nturtle.end_fill()\r\n\r\n\r\nturtle.up()\r\nturtle.color(\"black\")\r\nturtle.back(150)\r\nturtle.right (90)\r\nturtle.down()\r\nturtle.forward(30)\r\nturtle.right(90)\r\n\r\n# Lamp \r\nturtle.up()\r\nturtle.color(\"#FFA500\")\r\nturtle.fillcolor(\"#FFA500\")\r\nturtle.begin_fill()\r\nturtle.setpos (-50, 152)\r\nturtle.right(90)\r\nturtle.down()\r\n\r\nturtle.circle(50, 180)\r\nturtle.left(30)\r\nturtle.forward(100)\r\nturtle.left(120)\r\nturtle.forward(100)\r\nturtle.end_fill()\r\n\r\nturtle.up()\r\nturtle.setpos (-340, -200)\r\nturtle.color(\"White\")\r\nturtle.down()\r\nturtle.write(\"HAPPY DIWALI\", font=(\"Lucida Calligraphy\", 55))\r\n\r\n\r\n# Function Fire_Crackers\r\ndef move_to(x,y):\r\n    turtle.penup()\r\n    turtle.goto(x,y)\r\n    turtle.pendown()\r\n\r\n#1 Fire_Cracker 1\r\nmove_to(300,150)\r\nturtle.color(\"red\")\r\nangle=0\r\nfor i in range(20):\r\n    turtle.fd(50)\r\n    move_to(300,150)\r\n    angle+=18\r\n    turtle.left(angle)\r\n\r\n#Fire_Cracker 2\r\nmove_to(450,150)\r\nturtle.color(\"yellow\")\r\nangle=0\r\nfor i in range(20):\r\n    turtle.fd(50)\r\n    move_to(450,150)\r\n    angle+=18\r\n    turtle.left(angle)\r\n\r\n# Fire_Cracker 3\r\nmove_to(375,300)\r\nturtle.color(\"green\")\r\nangle=0\r\nfor i in range(20):\r\n    turtle.fd(50)\r\n    move_to(375,300)\r\n    angle+=18\r\n    turtle.left(angle)\r\n\r\n\r\n# Fire_Cracker 4\r\nmove_to(370,-300)\r\nturtle.color(\"violet\")\r\nangle=0\r\nfor i in range(20):\r\n    turtle.fd(50)\r\n    move_to(370,-300)\r\n    angle+=18\r\n    turtle.left(angle)\r\n\r\n# Fire_Cracker 5\r\nmove_to(-350,150)\r\nturtle.color(\"pink\")\r\nangle=0\r\nfor i in range(20):\r\n    turtle.fd(50)\r\n    move_to(-350,150)\r\n    angle+=18\r\n    turtle.left(angle)\r\n\r\n\r\n# Fire_Cracker 6\r\nmove_to(450,-150)\r\nturtle.color(\"blue\")\r\nangle=0\r\nfor i in range(20):\r\n    turtle.fd(50)\r\n    move_to(450,-150)\r\n    angle+=18\r\n    turtle.left(angle)\r\n\r\n# Fire_Cracker 7\r\nmove_to(-200,-300)\r\nturtle.color(\"orange\")\r\nangle=0\r\nfor i in range(20):\r\n    turtle.fd(50)\r\n    move_to(-200,-300)\r\n    angle+=18\r\n    turtle.left(angle)\r\n\r\n\r\n# Fire_Cracker 8\r\nmove_to(-450,-170)\r\nturtle.color(\"red\")\r\nangle=0\r\nfor i in range(20):\r\n    turtle.fd(50)\r\n    move_to(-450,-170)\r\n    angle+=18\r\n    turtle.left(angle)\r\n\r\n# Fire_Cracker 9\r\nmove_to(-500,-240)\r\nturtle.color(\"yellow\")\r\nangle=0\r\nfor i in range(20):\r\n    turtle.fd(50)\r\n    move_to(-500,-240)\r\n    angle+=18\r\n    turtle.left(angle)\r\n\r\n# Fire_Cracker 10\r\nmove_to(-500,120)\r\nturtle.color(\"skyblue\")\r\nangle=0\r\nfor i in range(20):\r\n    turtle.fd(50)\r\n    move_to(-500,120)\r\n    angle+=18\r\n    turtle.left(angle)\r\n\r\nturtle.up()\r\nturtle.setpos (400, -240)\r\nturtle.color(\"Yellow\")\r\nturtle.down()\r\nturtle.write(\"www.cbsepython.in\", font=(\"Arial\", 20))\r\nturtle.hideturtle()\r\nturtle.exitonclick()\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Output:<\/span><\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-3531 size-full\" src=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2022\/10\/Happy-Diwali-1.jpg\" alt=\"Happy Diwali Python Program using Turtle\" width=\"1343\" height=\"702\" title=\"\" srcset=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2022\/10\/Happy-Diwali-1.jpg 1343w, https:\/\/cbsepython.in\/wp-content\/uploads\/2022\/10\/Happy-Diwali-1-300x157.jpg 300w, https:\/\/cbsepython.in\/wp-content\/uploads\/2022\/10\/Happy-Diwali-1-1024x535.jpg 1024w, https:\/\/cbsepython.in\/wp-content\/uploads\/2022\/10\/Happy-Diwali-1-768x401.jpg 768w, https:\/\/cbsepython.in\/wp-content\/uploads\/2022\/10\/Happy-Diwali-1-400x209.jpg 400w\" sizes=\"(max-width: 1343px) 100vw, 1343px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Send Diwali wishes to your loving ones in cool way. Here we get a cool Happy Diwali Python Program using Turtle module.\u00a0 Happy Diwali Python Program using Turtle &nbsp; Source Code: import turtle #turtle.Screen turtle.bgcolor(&#8220;black&#8221;) turtle.up() turtle.color(&#8220;red&#8221;) turtle.fillcolor(&#8220;red&#8221;) # Diya turtle.setpos (-150, 100) turtle.down() turtle.right(90) turtle.begin_fill() turtle.circle(150, 180) turtle.left(90) turtle.forward (300) turtle.end_fill() turtle.up() turtle.color(&#8220;black&#8221;) turtle.back(150) [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":3531,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-3525","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-projects"],"_links":{"self":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/3525","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=3525"}],"version-history":[{"count":0,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/3525\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/media\/3531"}],"wp:attachment":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/media?parent=3525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/categories?post=3525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/tags?post=3525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}