Added rstrip() to each result prior to printing to automatically remove trailing whitespace.