# reorder.py # Walker M. White (wmw2) # September 2, 2012 """Functions for reordering a string (incomplete)""" def last_name_first(s): """Returns: copy of s but in the form , Precondition: s is in the form with one or more blanks between the two names""" # Find the first name first = first_name(s) end_first = s.find(' ') first_name = s[:end_first] # Find the last name # Put them together with a comma return first_name # Stub return def last_name_first2(s): """Returns: copy of s but in the form , Precondition: s is in the form with one or more blanks between the two names""" first = first_name(s) last = last_name(s) return last+', '+first def first_name(s): """Returns: First name in s Precondition: s is in the form with one or more blanks between the two names""" end_first = s.find(' ') return s[:end_first] def last_name(s): """Return: Last name in s Precondition: s is in the form with one or more blanks between the two names""" return '' # Stub return