I am trying string repetition in Python.
#!/bin/python str = 'Hello There' print str[:5]*2
Output
HelloHello
Required Output
Hello Hello
Can anyone please point me in the right direction .
Python version: 2.6.4
string = 'Hello There' print ' '.join([string[:5]] * 2)
2.1m questions
2.1m answers
60 comments
57.0k users