Modified print to use str.format() instead of % replacement.