Wrong output while trying to display count of .tsv file?


This code is returning 0 while trying to display constituency(particular city) from ls2014.tsv
Failed to trace out error.Any help.
thank you,


@vamsipenmetsa7 I have executed the below code in lab and got out put.

PFA for reference


def election(state,constituency):
     count = 0
     for i in state:
         if (i.split("\t")[1] == constituency):
             count += 1
     return count

election(state, "Anandpur Sahib")


showing 0 for some constituencies like Adilabad and Karimnagar ?


The data is having many tabs in between each field. thats causing the issue in output count function.