Seems to me this has a bug on Len<3 strings. This isn't a convention I've seen before, but I don't think anyone would shorten "in" to "i0n" or "I" to "I0I".
Ye I ended up putting a if len() in the function. No idea what I am using this for anyway, just a bit of fun.