The str coerces data into a string. Every datatype can be coerced into a string.
str(odbchelper)
"<module 'odbchelper' from 'c:\\docbook\\dip\\py\\odbchelper.py'>"
str(horsemen) #=['war', 'pestilence', 'famine', 'Powerbuilder']
"['war', 'pestilence', 'famine', 'Powerbuilder']"
str(1) # '1'
str works on any object of any type. Here it works on a list which you've constructed in bits and pieces.