Repeated String Hackerrank Solution In Python