Your Turn: Print ASCII Chart

You can print your own list of printable ASCII characters with the next example script.

Example script: chars_in_strings_your_turn

  • Enter this script and save it as characters_in_strings_your_turn.  
  • Flash the script into the micro:bit.
# chars_in_strings_your_turn

from microbit import *

sleep(1000)

print("ASCII")
print("Code     Character")
for n in range(32, 127):
    c = chr(n)
    print(n, "     ", c)
    sleep(250)
  • Open the terminal.
  • Verify that it prints all the printable characters, starting from space (which actually won't visibly display) to ~.