how to print variable few time?

andy wants at no.mail.local
Sun Nov 13 10:03:06 EST 2016


Sun, 13 Nov 2016 15:12:01 +0100 wrote andy:

> word=input()
> print((word+' ')*2, end='')
> print(word)
> 
>  ..but D'Apranos ' '.join(..) is far more elegant.

don't know whether I really would use this form, but it works in python3:

word = ' '.join([input()]*3)
print(word)



More information about the Python-list mailing list