On Wed, May 21, 2008 at 9:39 AM, Jeff Younker <[EMAIL PROTECTED]> wrote:
> On May 21, 2008, at 6:42 AM, Kinuthia Muchane wrote:
>
>>>>> st = "String"
>>>>> print "%s " %st*3
>>
>> String String String
>>>>>
>>
>> Does this help?
>
> Another approach is to use dictionaries for string
> replacement.
>
>>>> subst = {'some': 'thing'}
>>>> print "%(some)s%(some)s%(some)s"  % subst
> thingthingthing
>

As an alternate to repeating the formated string:

--> print '%(some)s'*3 % subst
thingthingthing

(forgot to reply all)

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

Reply via email to