title: How to check if an array is multidimensional
body: <p>I am trying to write a code to check if n is the maximum of the array A if it is return True if it isnt return False but I have two conditions if the value is a multidimentional or unidimentional I don't know how to write that:</p>
  
  <pre><code> if [A is unidimentional]:
       maximum=A[0]
       for i in range(A.shape[0]):
           if max(A[i],maximum)==A[i]:
               maximum=A[i]
       if max(n,maximum)!=n:
           return False
       return True
  
       else:
           maximum=A[0][0]
           for i in range(A.shape[0]):
           for j in range(A.shape[1]):
               if max(A[i][j],maximum)==A[i][j]:
                   maximum=A[i][j]
       if max(n,maximum)!=n:
           return False
       return True
  </code></pre>
  
  <p>if someone knows how I can write that condition it would be very helpful Thanks</p>