how to print variable few time?

Ben Bacarisse ben.usenet at bsb.me.uk
Sat Nov 12 08:30:17 EST 2016


guy asor <guy.asor132 at gmail.com> writes:

> this is my code:
>
> word=raw_input()
> print word*3
>
>
> with this code im getting - wordwordword.
> what changes i need to make to get - word word word - instead?

Two hints:

What does ['a']*3 give you?

What about '/'.join(['a', 'b', 'c'])?

Can you find a way now?

-- 
Ben.



More information about the Python-list mailing list