Simplify the function 'isNumberExpression()' in 'NumberExpression.py'