""" A module to show off how to "parse" a comma-separated list. This module only contains one function. You should study this function as you may find it helpful for Lab 2 (and therefore Assignment 1). Author: Walker M. White Date: August 31, 2017 (Python 3 Version) """ def second_in_list(s): """ Returns: second item in comma-separated list The final result does not have any whitespace on edges. Parameter s: The list of items Precondition: s is a string of items separated by commas. """ startcomma = s.index(',') tail = s[startcomma+1:] endcomma = tail.index(',') item = tail[:endcomma].strip() # Correct version #item = tail[:endcomma] # Compare this one return item