 # Draw Circle in Python using Turtle

## Draw Circle in Python using Turtle

Turtle is a Python feature like a drawing board, which lets us command a turtle to draw all over it! We can use functions like turtle.forward(…) and turtle.right(…) which can move the turtle around. Turtle is a beginner-friendly way to learn Python by running some basic commands and viewing the turtle do it graphically. It is like a drawing board that allows you to draw over it. The turtle module can be used in both object-oriented and procedure-oriented ways.
To draw, Python turtle provides many functions and methods i.e. forward, backward, etc. Some the commonly used methods are:

• forward(x): moves the pen in the forward direction by x unit.
• backward(x): moves the pen in the backward direction by x unit.
• right(x): rotate the pen in the clockwise direction by an angle x.
• left(x): rotate the pen in the anticlockwise direction by an angle x.
• penup(): stop drawing of the turtle pen.
• pendown(): start drawing of the turtle pen.

Now to draw a circle using turtle, we will use a predefined function in “turtle”.
circle(radius): This function draws a circle of the given radius by taking the “turtle” position as the center.
Example:

 `# Python program to demonstrate` `# circle drawing` ` ` ` ` `import` `turtle` `   ` `# Initializing the turtle` `t ``=` `turtle.Turtle()` ` ` ` ` `r ``=` `50` `t.circle(r)`

Output : #### Tangent Circles

A tangent is a line that touches the circumference of a circle from outside at a point, provided that any extension of the line will not cause intersection with the circle. Now, think about a group of circles, that have a common tangent. The group of circles, having common tangent, are known as tangent circles.
Example:

 `# Python program to demonstrate` `# tangent circle drawing` ` ` ` ` `import` `turtle` `   ` `t ``=` `turtle.Turtle()` ` ` `# radius for smallest circle` `r ``=` `10` ` ` `# number of circles` `n ``=` `10` ` ` `# loop for printing tangent circles` `for` `i ``in` `range``(``1``, n ``+` `1``, ``1``):` `    ``t.circle(r ``*` `i)`

Output : #### Spiral Circle

Spiral is a shape similar to a circle, except that the radius of the spiral gradually increases after every completed round.
Example:

 `# Python program to demonstrate` `# spiral circle drawing` ` ` ` ` `import` `turtle` `   ` `t ``=` `turtle.Turtle()` ` ` `# taking radius of initial radius` `r ``=` `10` ` ` `# Loop for printing spiral circle` `for` `i ``in` `range``(``100``):` `    ``t.circle(r ``+` `i, ``45``)`

Output : #### Cocentric Circles

The term concentric is used for a group of things having common. Now Circles having the same center are termed as Concentric Circle.

 `# Python program to demonstrate` `# concentric circle drawing` ` ` ` ` `import` `turtle` `   ` `     ` `t ``=` `turtle.Turtle()` ` ` `# radius of the circle` `r ``=` `10` ` ` `# Loop for printing concentric circles` `for` `i ``in` `range``(``50``):` `    ``t.circle(r ``*` `i)` `    ``t.up()` `    ``t.sety((r ``*` `i)``*``(``-``1``))` `    ``t.down()`

Output : Last Updated on October 24, 2021 by admin

## Python range() functionPython range() function

Python range() function Python range() function returns the sequence of the given number between the given range. range() is a built-in function of Python. It is used when a user needs to perform an action a specific number of times.

## Get Current Time in different Timezone using PythonGet Current Time in different Timezone using Python

Get Current Time in different Timezone using Python Timezone is defined as a geographical area or region throughout which standard time is observed. It basically refers to the local time of a region or country. Most of the time zones

## Selecting rows in pandas DataFrame (Based on conditions)Selecting rows in pandas DataFrame (Based on conditions)

Let’s see how to Select rows based on some conditions in Pandas DataFrame. Selecting rows based on particular column value using '>', '=', '=', '<=', '!=' operator. Code #1 : Selecting all the rows from the given dataframe in which

## Python Pickling with examplePython Pickling with example

Understanding Python Pickling with example Python pickle module is used for serializing and de-serializing a Python object structure. Any object in Python can be pickled so that it can be saved on disk. What pickle does is that it “serializes”

## Pandas DataFrame.dropna()Pandas DataFrame.dropna()

Python | Pandas DataFrame.dropna() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Sometimes csv file

## Python Program to print duplicates from a list of integersPython Program to print duplicates from a list of integers

Python | Program to print duplicates from a list of integers Given a list of integers with duplicate elements in it. The task to generate another list, which contains only the duplicate elements. In simple words, the new list should

## How to take integer input in Python?How to take integer input in Python?

How to take integer input in Python? In this post, We will see how to take integer input in Python. As we know that Python built-in input() function always returns a str(string) class object. So for taking integer input we

## gcd() in Pythongcd() in Python

gcd() in Python The Highest Common Factor (HCF) , also called gcd, can be computed in python using a single function offered by math module and hence can make tasks easier in many situations. Naive Methods to compute gcd Using Recursion: # Python