Full lesson Inside the computer 3–7 min

Pictures Made of 0s and 1s!

How can on and off make a picture?

Real Python code

This is the code from the video. Read it out loud like a recipe, one line at a time!

heart.py
heart = ["01010",
         "11111",
         "01110",
         "00100"]

for row in heart:
    row = row.replace("1", "#")
    print(row.replace("0", "."))

Quiz time!

How many bits does Bit's heart need?

quiz.py
01010
11111
01110
00100

Pixels are everywhere

Photos

A camera saves each photo as millions of pixels

Pixel art games

Big chunky pixels you can really see

Every screen

Phones, tablets and TVs light up rows of pixels

Colour pixels

Store how much red, green and blue light to mix

Pixels and bits

Pixels

  • Tiny squares in a grid
  • Each shows one colour
  • Lots make a picture
VS

Bits

  • Tiny on and off switches
  • 1 = on, 0 = off
  • One bit per black and white pixel

Pictures are made of pixels, and pixels are stored as bits!

Try it yourself!

On squared paper, colour a square for every 1 and leave it blank for every 0 to draw a picture from bits.

Bit is working on the next one: How the internet works

Liked this quest?

Subscribe to see the next one first! Ask a grown-up before subscribing.

Keep exploring