<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: sowmya2003</title>
    <description>The latest articles on DEV Community by sowmya2003 (@sowmya2003).</description>
    <link>https://dev.to/sowmya2003</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F733717%2F0c75bfa2-b405-4d7b-a5d5-407d95176925.png</url>
      <title>DEV Community: sowmya2003</title>
      <link>https://dev.to/sowmya2003</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sowmya2003"/>
    <language>en</language>
    <item>
      <title>CAN YOU DESIGN MULTICOLOURED STAR USING PYTHON??</title>
      <dc:creator>sowmya2003</dc:creator>
      <pubDate>Fri, 22 Oct 2021 19:52:26 +0000</pubDate>
      <link>https://dev.to/sowmya2003/can-you-design-multicoloured-star-using-python-50ed</link>
      <guid>https://dev.to/sowmya2003/can-you-design-multicoloured-star-using-python-50ed</guid>
      <description>&lt;p&gt;PYTHON TURTLE IS AN AMAZING LIBRARY .&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;turtle&lt;/em&gt; is Python’s pre-installed library that enables users to create small games, animations, etc., with easy-to-understand codes.&lt;/p&gt;

&lt;p&gt;With minimal and easy-to-understand codes that create beautiful shapes, it is a great way for kids to start their coding journey&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Get started with turtle&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Import the module
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;turtle&lt;/em&gt; is a pre-installed library in Python; therefore, we don’t need to install it explicitly.&lt;/p&gt;

&lt;p&gt;The turtle module and its methods can be used in a program once it is imported into your Python environment, which can be done as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```  
import turtle 

```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.Create a canvas
&lt;/h3&gt;

&lt;p&gt;Since turtle will perform graphic actions, it requires a canvas or separate workspace area to act on our commands. The turtle canvas or screen can be initialized, as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```   
screen=turtle.Screen()

```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Create a turtle
&lt;/h3&gt;

&lt;p&gt;We need a turtle to perform actions on the canvas. turtle object is instantiated by the creation of an object of the Turtle class defined in the turtle module.&lt;/p&gt;

&lt;p&gt;The turtle object is created as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;``` 
t=turtle.Turtle() 
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  CODE AS FOLLOWS:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import turtle
col=['yellow','red','green','blue','white','orange']
t=turtle.Turtle()
screen=turtle.Screen()
screen.bgcolor('black')
t.speed(30)
for i in range(100):
    t.color(col[i%6])
    t.forward(i*4)
    t.left(150)
    t.width(1)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
    </item>
  </channel>
</rss>
