The print
statement is putting in that whitespace.
From the docs here:
A space is written before each object is (converted and) written, unless the output system believes it is positioned at the beginning of a line.
Use ';'.join(...)
instead.