# Hello World example code for Cobble board in CircuitPython (https://cobble.tinkerfarm.net/). # Code by Bill Ball + AI. CC BY. # These are comment lines. They are not part of the program. # Notice required indents inside the loops. # Start an infinite loop to keep the program running until the user decides to stop. while True: # Print a blank line to the CircuitPython REPL console before the message. print() # Print the "Hello World!" message to the CircuitPython REPL console. print("From Cobble: Hello World!") # Print a blank line to the CircuitPython REPL console after the message. print() # Pause the program, display the prompt, wait for user input, remove extra spaces, and convert it to uppercase. # Single equal sign means load the results from the input request into the variable "response". response = input("Again? Y/N: ").strip().upper() # Check if the user typed "N" (or "n", since we converted it to uppercase). # Note that double equal means if the response variable is equal to "N". if response == "N": # Print a final message to let the user know the program is ending. # Use newline escape character \n to add blank lines. print("\nProgram stopped.\n") # Exit the while loop, which stops the program. break # what could we add to deal with cases other than Y or N?