<div class="gmail_quote">On Sun, Mar 6, 2011 at 8:46 PM, nookasree ponamala <span dir="ltr">&lt;<a href="mailto:nookasree@yahoo.com">nookasree@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit" valign="top"><div>Thanks for the reply Wayne, but still it is not working,</div>
<div> </div>
<div>when I used int It throws the below error:</div>
<div><div class="im">  File &quot;&lt;stdin&gt;&quot;, line 2, in &lt;module&gt;<br>  File &quot;&lt;stdin&gt;&quot;, line 3, in summary<br></div>  File &quot;&lt;stdin&gt;&quot;, line 3, in &lt;genexpr&gt;<br>ValueError: invalid literal for int() with base 10: &quot;&#39;&quot;</div>

<div> </div>
<div>I tried using float and the error is:</div>
<div><div class="im">Traceback (most recent call last):<br>  File &quot;&lt;stdin&gt;&quot;, line 2, in &lt;module&gt;<br>  File &quot;&lt;stdin&gt;&quot;, line 3, in summary<br></div>  File &quot;&lt;stdin&gt;&quot;, line 3, in &lt;genexpr&gt;<br>
ValueError: invalid literal for float(): &#39;</div>
<div> </div>
<div>Thanks,</div>
<div>Sree.<br><br></div></td></tr></tbody></table></blockquote><div><br>
</div></div>I played with it a bit and simplified things a (little) bit:<br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">       b = (aline[3].strip(&#39;$&#39;))<br>
       t = (a, float(b))<br>       tot.append(t)<br>       print tot<br></blockquote><br>You were converting the tuple to a string before adding it to the list; you don&#39;t need to do that, and it was concealing the real cause of your problem, which is that you either need to skip/get rid of the top line of your file, or write some error-handling code to deal with it.  Currently, you&#39;re trying to convert the string &#39;amt&#39; into a number, and you just can&#39;t do that.<br>