Python repeat string
string = 'Hello There'
print ' '.join([string[:5]] * 2)
In case if you want just to repeat any string
"Hello world " * 2
Do this:
str = 'Hello There'
print str[:6]*2
that will ad a space after the second "Hello" if that's ok. Also, like rajpy said you shouldn't use str
as a variable because its a keyword in python.
Because then you're getting the space in between the two words and putting it in between the hello's
that should work!
P.S you don't need the #!/bin/python