Chapter 7 Counting with buttons

import time
from adafruit_circuitplayground import cp

count = 0

while True:
    if cp.button_b:
        count += 1
        cp.pixels[9] = (0, 255, 0)
        time.sleep(.2)
        print(count)
        cp.pixels[9] = (0, 0, 0)
    if cp.button_a:
        count -= 1
        cp.pixels[0] = (255, 0, 0)
        time.sleep(.2)
        print(count)
        cp.pixels[0] = (0, 0, 0)