alias
repeat a string
alias lang_id
how to
repeat a string
lang_id
python
qid
11002

How to
repeat a string in Python

Use * operator, like s * n.

print "abc" * 3  # abcabcabc

s = "abc"
n = 3
print s * n      # abcabcabc
Select default language: