{"id":966,"date":"2021-06-10T21:36:33","date_gmt":"2021-06-10T16:06:33","guid":{"rendered":"https:\/\/cbsepython.in\/?p=966"},"modified":"2022-01-25T11:12:53","modified_gmt":"2022-01-25T05:42:53","slug":"rainbow-generator-python-program","status":"publish","type":"post","link":"https:\/\/cbsepython.in\/rainbow-generator-python-program\/","title":{"rendered":"Rainbow Generator-Python Program for Class 12"},"content":{"rendered":"<p>Rainbow Generator-Python Program<\/p>\n<p>Source Code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import turtle\r\n\r\ncolours=['#801ED0','#962CE4','#912CE2', '#7C21D4','#731FCF',\r\n         '#6113C1','#4005AD','#2B049F', '#28039E','#060390',\r\n         '#00038E','#001C9A','#0033A8', '#014AB3','#0094DE'\r\n         ,'#00C8F9','#01E7CD','#01CE8B', '#01B750','#07B635'\r\n         ,'#20BD26','#7CE413','#9CEE0D', '#DFFC02','#F2FB00',\r\n         '#FEED01','#FFAF02','#FF9501', '#FE5500','#FF2404'\r\n         ,'#FE0700', '#FF0100']\r\nwn=turtle.Screen()\r\n\r\nwn.bgcolor('black')\r\nskk=turtle.Turtle()\r\nskk.speed(0)\r\nskk.width(1.5)\r\nskk.hideturtle()\r\n\r\n\r\n\r\nskk.left(90)\r\nx=0\r\na=100\r\nb=45\r\nwhile x&lt;len(colours):\r\n    skk.color(colours[x])\r\n    skk.penup()\r\n    skk.setpos(b,0)\r\n    skk.pendown()\r\n    skk.circle(a,180,4000)\r\n    skk.right(180)\r\n    x=x+1\r\n    b=b+1.5\r\n    a=a+1.5\r\n\r\nturtle.mainloop()\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Output:<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-968\" src=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/06\/RainBow-300x203.jpg\" alt=\"\" width=\"727\" height=\"492\" title=\"\" srcset=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/06\/RainBow-300x203.jpg 300w, https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/06\/RainBow-400x270.jpg 400w, https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/06\/RainBow.jpg 681w\" sizes=\"(max-width: 727px) 100vw, 727px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rainbow Generator-Python Program Source Code: import turtle colours=[&#8216;#801ED0&#8242;,&#8217;#962CE4&#8242;,&#8217;#912CE2&#8217;, &#8216;#7C21D4&#8242;,&#8217;#731FCF&#8217;, &#8216;#6113C1&#8242;,&#8217;#4005AD&#8217;,&#8217;#2B049F&#8217;, &#8216;#28039E&#8217;,&#8217;#060390&#8242;, &#8216;#00038E&#8217;,&#8217;#001C9A&#8217;,&#8217;#0033A8&#8242;, &#8216;#014AB3&#8242;,&#8217;#0094DE&#8217; ,&#8217;#00C8F9&#8242;,&#8217;#01E7CD&#8217;,&#8217;#01CE8B&#8217;, &#8216;#01B750&#8242;,&#8217;#07B635&#8242; ,&#8217;#20BD26&#8242;,&#8217;#7CE413&#8242;,&#8217;#9CEE0D&#8217;, &#8216;#DFFC02&#8242;,&#8217;#F2FB00&#8217;, &#8216;#FEED01&#8242;,&#8217;#FFAF02&#8242;,&#8217;#FF9501&#8217;, &#8216;#FE5500&#8242;,&#8217;#FF2404&#8242; ,&#8217;#FE0700&#8217;, &#8216;#FF0100&#8217;] wn=turtle.Screen() wn.bgcolor(&#8216;black&#8217;) skk=turtle.Turtle() skk.speed(0) skk.width(1.5) skk.hideturtle() skk.left(90) x=0 a=100 b=45 while x&lt;len(colours): skk.color(colours[x]) skk.penup() skk.setpos(b,0) skk.pendown() skk.circle(a,180,4000) skk.right(180) x=x+1 b=b+1.5 a=a+1.5 turtle.mainloop() &nbsp; Output: &nbsp; &nbsp;<\/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-966","post","type-post","status-publish","format-standard","hentry","category-python-projects"],"_links":{"self":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/966","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=966"}],"version-history":[{"count":0,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/966\/revisions"}],"wp:attachment":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/media?parent=966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/categories?post=966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/tags?post=966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}