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 *


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