Crappy broken python code

Traceback (most recent call last):
  File "scrape.py", line 50, in <module>
    check_bridges()
  File "scrape.py", line 37, in check_bridges
    set_lights(bridges)
  File "scrape.py", line 15, in set_lights
    if (bridges[j] == 0):
IndexError: tuple index out of range