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

About this activity
Use block coding or simple Python to create colorful digital drawings and animated patterns, experimenting with shapes, colors, and repetition to learn programming.
What you need
Step by step
- 1
Step 1
Pick whether you want to use block coding like Scratch or simple Python with the Turtle library.
- 2
Step 2
Open a new project or file in the platform you chose.
- 3
Step 3
Set up a blank canvas or stage and choose a background color.
- 4
Step 4
Add a sprite or write a small function that draws one simple shape like a circle or square.
- 5
Step 5
Set the drawing color or fill color you want your shape to use.
- 6
Step 6
Use a loop block or a for loop to draw the shape many times so a pattern begins to form.
- 7
Step 7
Inside the loop change the shape size or rotate it a little each repetition to make interesting patterns.
- 8
Step 8
Inside the same loop change the color step by step to create a gradient or rainbow effect.
- 9
Step 9
Add a short wait or delay inside the loop so you can see the pattern animate.
- 10
Step 10
Run your program and watch the animated drawing appear on the screen.
- 11
Step 11
Save your project so you do not lose your artwork.
- 12
Step 12
Share your finished creation on DIY.org.
Fun facts
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.
Watch & Learn
Need 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.