# debug_name.py # Walker M. White (wmw2) # August 31, 2012 """Debug version of the module name This module is exactly like the module name, except that we have added print statements after every assignment. These allow us to 'visualize" the program while it is running, and hence isolate the error. However, they will eventually need to be removed when we find the error.""" def last_name_first(n): """Returns: copy of n but in the form 'last-name, first-name' Precondition: n is in the form 'first-name last-name' with one or more blanks between the two names no spaces in or """ print 'Starting last_name_first' end_first = n.find(' ') print 'end_first is "'+str(end_first)+'"' first = n[:end_first] print 'first is "'+str(first)+'"' last = n[end_first+1:] print 'last is "'+str(last)+'"' print 'Finishing last_name_first' print '' # prints a blank line return last+', '+first