>Why is the first one so slow? Because you're duplicating the entire string every time you add a single character to it. A similar situation arises in Java; one should use a StringBuffer object instead. In Python this can be accomplished by appending chars to the end of a list and then stringifying it: no StringBuffer needed. C//