How to generate a continuous string
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Mon Apr 16 06:09:48 EDT 2007
In <1176717806.754728.9600 at y80g2000hsf.googlegroups.com>,
人言落日是天涯,望极天涯不见家 wrote:
> How to generate a continuous string, like this
> "aaaaaaaaaaaaaaaaaaaaaaa"
> the number of characters is dynamic. Is there a module or function
> implement this string ?
> such as: duplicate_string(char, num)
Even easier: multiply the string by a number.
In [12]: 'a' * 5
Out[12]: 'aaaaa'
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list