Member-only story

How to create Amazing Circle Shape in Python- with Just two Lines of Codes

Mayurkumar Surani
2 min readDec 8, 2021

How do you like this image ? Is is possible to create such image in python in just two lines of code ??

The answer is yes. Python is versatile programming languages which is quite popular in second decade of 21st century.

In order to create amazing circle shapes in python , I will walk you through simple two lines of codes.

In order to create amazing circle shapes, turtle module is required to install in environment. In this case, I am using Jupyter IDE and i will install turtle module in Jupyter IDE.

# How to create Mind-blowing Wheel in python

Step No 01 : #import turtle module or install it by typing “ !pip install turtle”

import turtle

Step No 02

turtle.bgcolor(‘black’)
turtle.speed(60)
turtle.pensize(1)
colors=(‘purple’,’megenta’,’orange’,’dark green’,’pink’)

for i in range(200):
turtle.forward(i*4)
turtle.right(91)
turtle.color(colors[i%5])

--

--

Mayurkumar Surani
Mayurkumar Surani

Written by Mayurkumar Surani

AWS Data Engineer | Data Scientist | Machine Learner | Digital Citizen

No responses yet