File read Python - IndexError: list index out of range
<pre><code>def compare():
        file1=open("Rules.txt")
        for rules in file1:
            rule = rules.split(",")
            break
        membersFile=open("Members.txt")
        for members in membersFile:
            member = members.split(',')
            break
        print (rule[0] + "," +member[1] + ","+ rule[1] + "," +member[2] + ","+  rule[2] + "," + member[3])
        if (rule[0]&lt;=member[1]) and (rule[1]&lt;=member[2]) and (rule[2]==member[  3]):
            print (member[0] + " is Continued")
        else:
            print (member[0] + " is Discontinued")
compare()
</code></pre>

<p>I am getting the following error:</p>

<pre><code>print (rule[0] + "," +member[1] + ","+ rule[1] + "," +member[2] + ","+  rule[2] + "," + member[3])
IndexError: list index out of range
</code></pre>