I have this code for a parking system. When the number of spaces goes above 20 it sends and error message due to 20 being the limit of spaces. I want to try shutdown the program after this point.
I have tried doing what you can do in Python. This is:
import sys
display.scroll("Error: Limit exceeded.")
sys.exit()
This gives me an attribute error.
from microbit import *
import sys
elif spaces > 20:
display.scroll("Error: The spaces have exceeded the limit.")
sys.exit()
This should shutdown the program, not letting it to function, after the elif statement. There is more code (if statements, loops, function) but it is irrelevant.
Thanks :)