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.
@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") == constituency): count += 1 return count state=open("ls2014.tsv").read().splitlines() election(state, "Anandpur Sahib")
The data is having many tabs in between each field. thats causing the issue in output count function.