Drawing Preset Figures

Drawing Preset Figures

  • You want to draw a circle. If you attempt to draw it in the same way as you drew the square, then it would be extremely tedious, and you’d have to spend a lot of time just for that one shape. Thankfully, the Python turtle library provides a solution for this. You can use a single command to draw a circle.

Source Code:

#Follow - Programmerfect

import turtle as t
t.circle(60)

Output:

Note : The number within the brackets is the radius of the circle. You can increase or decrease the size of the circle by changing the value of its radius.

In the same way, you can also draw a dot :

Source Code:

#Follow - Programmerfect

import turtle as t
t.dot(20)
 


Output:


Note : The number within the brackets is the diameter of the dot. Just like with the circle, you can increase or decrease the size of the dot by changing the value of its diameter.



Comments

  1. Remarkable post. I simply came across your blog and desired to say that I have really enjoyed searching your blog posts. Thank you for sharing such blogs. Photo Presets

    ReplyDelete

Post a Comment