last_repeats.py - def go ann x = 0 for row in range(0...

This preview shows page 1 out of 1 page.

def go( ann ): x = 0 for row in range(0 , len(ann), 1): for col in range(0, len(ann[row]),1): if ann[row][col] == ann[-1][-1]: x = x + 1 if x > 1: return True else: return False print ( go( [[1,2],[3,4,5]] ) ) print ( go( [[99,2,3],[3,4,5],[3,5]] ) ) print ( go( [[1,2,3],[3,4,5],[3,3]] ) ) print ( go( [[1]] ) ) print ( go( [[2],[3]] ) )

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture