DEV Community

Pandeyashish17
Pandeyashish17

Posted on

3

Let's create corona virus using python

Welcome to the wild and wacky world of turtle graphics! Today, we're going to explore the world of turtle programming by creating a fun, virus-like image.

Full Code:



import turtle
turtle.speed(40)
turtle.color('cyan')
turtle.bgcolor("black")
b = 200
while b > 0:
    turtle.left(b)
    turtle.forward(b*3)
    b = b - 1




Enter fullscreen mode Exit fullscreen mode

First, we're going to import the turtle module and set the speed to 40. This means that the turtle will move quickly, creating a cool, dynamic effect. Next, we're going to set the color to cyan and the background color to black. This creates a cool, neon-like effect that will make our virus stand out.

Now comes the fun part: the while loop. This loop will run as long as the variable "b" is greater than 0. Inside the loop, we're going to have the turtle move left by the value of "b", then move forward by "b" times 3. Finally, we'll decrease the value of "b" by 1.

As the loop runs, the turtle will create a spiral-like pattern that looks like a virus spreading and infecting the screen. And with the high speed of turtle movement, this effect is amplified and looks dynamic.

As the loop runs, you'll notice the spiral getting smaller and smaller. This is because we're decreasing the value of "b" by 1 each time the loop runs. Finally, when "b" is equal to 0, the loop will stop running, and our virus-like image will be complete!

Corona Virus

In conclusion, turtle graphics is a fun and easy way to create cool, dynamic images. This little program can be used as a base to make more complex graphics, Or used to make cool animation with multiple turtle and different shapes. Give it a try and unleash your inner artist!

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay