how to print variable few time?

andy wants at no.mail.local
Sun Nov 13 09:12:01 EST 2016


Sat, 12 Nov 2016 04:58:20 -0800 wrote guy asor:

> hello!
> 
> 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?
> 
> thanks

using python3.x:

word=input()
print((word+' ')*2, end='')
print(word)

 ..but D'Apranos ' '.join(..) is far more elegant.



More information about the Python-list mailing list