Countdown to Christmas Makes Challenge 2017 – Day 20

# Frosty The Snowman
# by @KariLawler (Twitter)
# Created: 20/Dec/17, v1.0
from microbit import *
import music

frosty_the_snowman = [
    'g4:8', 'e4:6', 'f4:2',
    'g4:4', 'c5:8', 'b4:2', 'c5:2',
    'd5:4', 'c5:4', 'b4:4', 'a4:4',
    'g4:12', 'b4:2', 'c5:2',
    'd5:4', 'c5:4', 'b4:4', 'a4:2', 'a4:2',
    'g4:4', 'c5:4', 'e4:4', 'g4:2', 'a4:2',
    'g4:4', 'f4:4', 'e4:4', 'f4:4',
    'g4:12', 'r:4'
]

music.set_tempo(bpm = 170)
while True:
    if button_a.is_pressed():
        for note in frosty_the_snowman:
            if note[0] != "r":
                display.show(note[0].upper(), delay=150, wait=False, clear=True)
            music.play(note)