On Thu, 24 Jul 2014 22:44:51 -0400, Dave Angel wrote: > fl <rxjw...@gmail.com> Wrote in message: > > >> I am puzzled about the last part of your code and want to learn >> from it (" * " " + "*" "). >> >> > 6 * " " + "x" > > will produce a string of 6 blanks followed by an x.
Dave is correct, but if you want to format text to a certain width, it is better to have Python count how many spaces you need: py> 'spam'.rjust(20) ' spam' py> 'spam'.ljust(20) 'spam ' py> 'spam'.center(20) ' spam ' In recent versions, you can even specify the fill character: py> 'spam'.center(20, '.') '........spam........' -- Steven -- https://mail.python.org/mailman/listinfo/python-list