Maximum limit upto which we can place digit . If tight is false , means number has already become smaller so we can place any digit , otherwise N [ pos ]
if ( tight ) : NEW_LINE INDENT upper_limit = ord ( N [ pos ] ) - ord ( '0' ) NEW_LINE DEDENT else : NEW_LINE INDENT upper_limit = 9 NEW_LINE DEDENT