There may be more than one digits in the number .
while ( i < len ( tokens ) and tokens [ i ] . isdigit ( ) ) : NEW_LINE INDENT val = ( val * 10 ) + int ( tokens [ i ] ) NEW_LINE i += 1 NEW_LINE DEDENT values . append ( val ) NEW_LINE