How to generate a continuous string

charles.hebert at gmail.com charles.hebert at gmail.com
Mon Apr 16 12:09:52 CEST 2007


On 16 avr, 12:03, "人言落日是天涯,望极天涯不见家" <kelvin.... at gmail.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)

>>> "a"*10
'aaaaaaaaaa'
>>> "a"*20
'aaaaaaaaaaaaaaaaaaaa'


More information about the Python-list mailing list