[Tutor] A file containing a string of 1 billion random digits.

Steven D'Aprano steve at pearwood.info
Tue Jul 20 01:58:41 CEST 2010


On Tue, 20 Jul 2010 09:53:25 am Steven D'Aprano wrote:

> This is how you would do it with the asterisk: you need a
> meta-template to make a template.

Doh! I meant *without* the asterisk.

> >>> meta = "(a) %%05d | (b) %%0%dd"
> >>> template = meta % 5
> >>> template % (42, 42)
>
> '(a) 00042 | (b) 00042'



-- 
Steven D'Aprano


More information about the Tutor mailing list