#!/usr/bin/env python3 
################################################################################### 
# try/except
################################################################################### 
print("Content-Type: text/html \n")     #http header with newline char (required for the web)
print('<pre>')                          #to produce better display on the web 

string = 'hello'

try:
    result = string/2
except:
    result = 'invalid divide'

print(result)

print('<br>')

try:
    result = string/2
except Exception as e:
    result = 'invalid operation: ' + str(e)

print(result)