My program is supposed to take an input in form of a string and split into to strings, one with all the lower case letters, underscores and dots. The other one with all the uppe
as @willemVanOnsem pointed out, you are recursively calling this on the string minus the first char. Eventually, you are calling it on an empty string, which is why you get an index error. check that "letters" is not empty before doing anything else.
as a side note, I don't think your recursive call is going to do what you expect.
can you use a while loop? you mention not using a for loop? or do you have to use recursion?