Smith, Jeff wrote:
But in my mind nothing beats the Perl statement:
newstr = "$s $n $r";

for clarity, ease of use, and maintainability.

Only a little ease of use is lost with the following in Python, clarity and maintainability are kept, and it even will let you format the output (as in # of decimal places)


newstr = "%{s}s %(n)s %(r)s"%locals()

If you cannot assume a type you can always just use %s...

Hugo

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to