Functions#

This is Exercise 2 of the Micro Python Tutorial.

We can define functions in Python. Functions are defined globally, within the file/module as they begin in column 0.

def display_message(message): print(message)

try: display_message('hello world.') except Exception: print('an error occurred: {}'.format(e)) finally: print('complete.')