<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">"""
Trace statements illustrating control statment flow

Trace statements are just print statements that tell us
where we are in the code.  They are distinct from a
watch, which tells us the current contents of a variable.

Author: Walker M. White
Date:   August 31, 2017 (Python 3 Version)
"""


def max2(x,y):
    """
    Returns: max of x, y
    
    Shows of flow of if-else
    """
    # Put max of x, y in z
    print('before if')
    if x &gt; y:
        print('if x&gt;y') # trace
        z  = x
        print('z is '+str(z)) # watch
    else:
        print('else x&lt;=y')
        z  = y
        print('z is '+str(z)) # watch
    print('after if')
    return z


def max3(x,y,z):
    """
    Returns: max of x, y, z
    
    Shows of flow of if-elif-else
    """
    # Put max of x, y, z in w
    print('before if')
    if x &gt; y and x &gt; z:
        print('if x&gt;y and x&gt;z') # trace
        w  = x
        print('w is '+str(w)) # watch
    elif y &gt; z:
        print('elif y&gt;z and y&gt;=x') # trace
        w  = y
        print('w is '+str(w)) # watch
    else:
        print('else z&gt;=x and z&gt;=y')
        w  = z
        print('w is '+str(w)) # watch
    print('after if')
    return w


</pre></body></html>