Pushing 1 to 9 because all number from 1 to 9 have this property .
s = [ ] NEW_LINE for i in range ( 1 , 10 ) : NEW_LINE INDENT if ( i <= n ) : NEW_LINE INDENT s . append ( i ) NEW_LINE result += 1 NEW_LINE DEDENT DEDENT