How to get the last value in a list/string using Python
<p>I am a beginner in writing Python scripts and I need help on the following:</p>

<p><code>Threads::num,47141,47146,47151,47156,47161,47166,47171,47176</code></p>

<p>How can I get and display the last value '47176'</p>

<p>The following is the part of the code I have written:</p>

<pre><code>elif sys.argv[1] == "-c":
    b = sys.argv[2]
    with open(b) as f:
        for line in f:
            if 'Threads::num' in line:
                print line.strip(',').split(',')[-1]
                print line
</code></pre>

<p>The output of this code is that it displays all the values as follows <code>Threads::num,47141,47146,47151,47156,47161,47166,47171,47176</code></p>
