Creating Art with Code
Green highlight

Use block coding or simple Python to create colorful digital drawings and animated patterns, experimenting with shapes, colors, and repetition to learn programming.

Orange shooting star
Download Guide
Collect Badge
Background blob
Challenge Image
Skill Badge
Table of contents

Step-by-step guide to create art with code

What you need
An account or access to a coding site or editor, curiosity and creativity, scratch or python turtle

Step 1

Pick whether you want to use block coding like Scratch or simple Python with the Turtle library.

Step 2

Open a new project or file in the platform you chose.

Step 3

Set up a blank canvas or stage and choose a background color.

Step 4

Add a sprite or write a small function that draws one simple shape like a circle or square.

Step 5

Set the drawing color or fill color you want your shape to use.

Step 6

Use a loop block or a for loop to draw the shape many times so a pattern begins to form.

Step 7

Inside the loop change the shape size or rotate it a little each repetition to make interesting patterns.

Step 8

Inside the same loop change the color step by step to create a gradient or rainbow effect.

Step 9

Add a short wait or delay inside the loop so you can see the pattern animate.

Step 10

Run your program and watch the animated drawing appear on the screen.

Step 11

Save your project so you do not lose your artwork.

Step 12

Share your finished creation on DIY.org.

Final steps

You're almost there! Complete all the steps, bring your creation to life, post it, and conquer the challenge!

Complete & Share
Challenge badge placeholder
Challenge badge

Help!?

What can we use if we can't access Scratch or Python's Turtle for this activity?

If you can't use Scratch or Turtle, try browser-based alternatives like Code.org or Trinket (which runs Turtle in the browser) or Scratch Desktop, and follow the same steps to set a stage/background, add a sprite or draw a shape, loop, and save.

My pattern doesn't animate or the colors don't change—what should I check?

Make sure the size/rotate and color-change commands are inside the same loop and include a short wait/delay (or use screen.tracer()/turtle.update() in Python or a wait block in Scratch) so each iteration draws and the gradient/animation appears.

How can I adapt this project for different ages?

For younger kids use Scratch with one simple loop, larger shapes, and visible wait blocks, while older kids can use Python Turtle, multiple nested loops, functions to draw several shapes, and formula-based color changes before saving and sharing.

How can we extend or personalize the coded artwork after we finish the basic pattern?

Extend the project by adding multiple sprites or functions to draw different shapes, using keyboard input to change colors, recording frames to export a GIF, or adding sound effects before saving and sharing on DIY.org.

Watch videos on how to create art with code

0:00/0:00

Here at SafeTube, we're on a mission to create a safer and more delightful internet. 😊

Creatice Coding: Art in the Computer Science Classroom

4 Videos

Facts about creative coding for kids

🌀 Even a few lines of code with repetition and simple rules can create complex patterns like spirals, tessellations, and fractals.

🖥️ Generative art uses algorithms so one set of code can make countless unique images and animations.

🎨 Processing was created to teach artists and designers to code and is widely used for creative coding and interactive installations.

🐍 Python's turtle module turns simple commands into colorful drawings — perfect for learning how code controls shapes.

🧩 Scratch lets kids snap code blocks together to make interactive stories and animations, with millions of projects shared online.

How do you create art with code using block coding or Python?

Start by choosing a kid-friendly platform like Scratch, MakeCode, or Python’s Turtle editor. Create a new project, sketch a simple design on paper, then code basic shapes (circles, squares) using blocks or commands. Use loops for repeated patterns, change colors and stroke size, and add variables to animate movement. Test often, tweak parameters, and save or export your work. Encourage experimenting with repetition, symmetry, and timing to make animated patterns.

What materials do I need to make digital drawings and animated patterns with code?

You need a computer or tablet and internet for web tools, plus a keyboard and mouse or touch screen. Install or use Scratch, MakeCode, Trinket, or a Python environment (Thonny, IDLE) with the turtle module. Optional items: headphones, a printer to keep sketches, and a micro:bit or Raspberry Pi for physical output. Paper and pencil are helpful for planning designs before coding.

What ages is coding art suitable for?

Block coding art is great for ages 5–12; younger kids (5–7) do best with adult guidance and drag‑and‑drop blocks. Simple Python with Turtle suits children about 8–14 who can read basic syntax, while teens can explore more complex animations and libraries. Adapt difficulty by offering templates for beginners and open challenges for older kids. Supervision helps for setup and online accounts.

What are the benefits of creating art with code?

Coding art builds creativity, pattern recognition, and computational thinking while making math and geometry fun. Kids learn problem‑solving, sequencing, and persistence when debugging. It boosts confidence as they see immediate visual results, and supports cross‑subject learning (art and STEM). Collaborative projects teach communication, and saving work builds a digital portfolio that shows progress over time.
DIY Yeti Character
Join Frame
Flying Text Box

One subscription, many ways to play and learn.

Try for free

Only $6.99 after trial. No credit card required

Creating Art with Code. Activities for Kids.