#########################################################################################
# Prompt for input and do some processing
# This example uses "functions".
# Functions allow the program to be built from small reusable modules.
# WORM - Write Once Reuse Many - this is better programming.
#########################################################################################

def hello():
  print("Hello to you too!")
  
def add():
  n1 = input("\nPlease type a number and press enter ... ");
  n2 = input("\nPlease type another number and press enter ... ");
  print("\n" + n1, "+", n2, "=", int(n1) + int(n2))  # int() converts text to an integer
  
def error():
  print("\nCommand not recognised. Please select from the menu.")

           # cmd is a variable. It's a storage location where a value can be saved.
cmd = ""   # Set cmd to empty text

while cmd != "QUIT":     # Repeat the indented code until the input is "QUIT".
  print ("\n\n")                                          # Some blank lines
  print ("MENU - Please select from the following ...")   # Prompt for menu choice
  print ("  QUIT")
  print ("  HELLO")
  print ("  ADD")
  cmd = input("\nPlease select from the menu above ... ")
  print ("\n" + cmd)
  
  match cmd:                              # This code requires Python3.10 or later
    case "HELLO":
      hello()
    case "ADD":
      add()
    case "QUIT":
      continue
    case unknown_command:
      error()

print ("\nBye Bye !\n\n ")