Generate n characters from above set and add these characters to captcha .
captcha = " " NEW_LINE while ( n ) : NEW_LINE INDENT captcha += chrs [ random . randint ( 1 , 1000 ) % 62 ] NEW_LINE n -= 1 NEW_LINE DEDENT return captcha NEW_LINE