# Messages.py (c) Kari Laitinen # http://www.naturalprogramming.com # 2006-04-12 File created. # 2022-12-16 Converted to Python 3. # This example demonstrates the calling of a simple function. # In Python programs functions are defined with the def keyword. # Functions must be defined (or imported) before they can be called. def print_message() : print( "\n This is function named \"print_message\".", end="" ) print( "\n Functions usually contain many statements. ", end="" ) print( "\n Let us now return to the calling program.", end="" ) # The main program begins. print( "\n THIS IS THE FIRST STATEMENT IN THE \"MAIN\" PROGRAM.", end="" ) print_message() print( "\n THIS IS BETWEEN TWO FUNCTION CALLS.", end="" ) print_message() print( "\n END OF \"MAIN\" PROGRAM.\n" )