title: How do a check if a column or row in a nested list has the same string
body: <p>I need to check if a nested list has a column with the same string</p>
  <pre><code>grid = [
    [&quot;x&quot;, &quot; &quot;, &quot;x&quot;],
    [&quot;x&quot;, &quot; &quot;, &quot; &quot;],
    [&quot;x&quot;, &quot;x&quot;, &quot;x&quot;]
  ]
  #if grid has a column or row with the same string (such as the first column and last row) then it will say &quot;yes&quot;
  </code></pre>
  <p>I've only managed to do it for rows:</p>
  <pre><code>grid = [
    [&quot;x&quot;, &quot; &quot;, &quot;x&quot;],
    [&quot;x&quot;, &quot; &quot;, &quot; &quot;],
    [&quot;x&quot;, &quot; &quot;, &quot;x&quot;]
  ]
  print(grid)
  
  
  row = ['x', 'x', 'x']
  
  
  if row in grid:
    print(&quot;Yes&quot;)
  else:
    print(&quot;no&quot;)
  </code></pre>