Hi All,<br><br>I'm a new bie to programming and need some assistance in this code. <br><br>I have a function which will split the given string into 3 characters each and I want to achieve this by recursion.<br><br>I have written the following code, but I don't know how to stop the recursion when the length of the remaining string is less than or equal to 3 characters. Any inputs on this please?<br>
<br>string = 'This is a sample python programming'<br>space = 2<br>final_result = []<br>def strsplit(stri, spa):<br>    s = stri[:spa]<br>    final_result.append(s)<br>    stri = stri[spa:]<br>    strsplit(stri,spa)   <br>
    return final_result<br>c = strsplit(string,space)<br>print 'The final result is: ', c<br><br>