title: Python Float and Replace More Than One
body: <p>I will straight to the point.</p>
  <p>First I have an exam scores like this :
  ( The scores as string )</p>
  <ol>
  <li>Student A : &quot;550.4&quot; -&gt; &quot;.&quot; = point</li>
  <li>Student B : &quot;1,098.9&quot; -&gt; &quot;,&quot;(coma) = thousand symbol, &quot;.&quot; = point</li>
  <li>Student C : &quot;1,100.00&quot; -&gt; &quot;,&quot;(coma) = thousand symbol, &quot;.&quot; = point</li>
  <li>Student D : &quot;999.99&quot; -&gt; &quot;.&quot; = point</li>
  </ol>
  <p>Criteria :</p>
  <ol>
  <li>When a score equal to or less than 600.00, then display &quot;Study more!&quot;</li>
  <li>score &lt;= 600, display &quot;Study more!&quot;</li>
  <li>When a score equal to or more than 1,000.00 (thousand), then display &quot;Get your reward!&quot;</li>
  <li>score =&gt; 1,000.00, display &quot;Get your reward!&quot;</li>
  </ol>
  <p>What I want is when one of the students score's meet one of the criteria then display a special messages. So to compare the scores with criteria I use this code ( code below ) :</p>
  <pre><code>'''
  SA = &quot;550.40&quot;
  SB = &quot;1,098.90&quot;
  SC = &quot;1,100.00&quot;
  SD = &quot;999.99&quot;
  
  SA = float(SA) #return 550.4 (as number)
  SB = float((SB[0:8]).replace(',','.')) #return error : 'ValueError: could not convert string to float: 1,098.90'
  SC = float((SC[0:8]).replace(',','.')) #return error : 'ValueError: could not convert string to float: 1,100.00'
  SD - float(SD) #return 999.99 (as number)
  '''
  </code></pre>
  <blockquote>
  <p>Note : I use [0:8] in hope all the score value (as string) will be
  convert to score(as number, float)
  If [0:8] does not get all the score value then please correct me</p>
  </blockquote>
  <p>Whenerver I use &quot;replace(',','.')&quot; and meet this condition &quot;XX,XXX.XX&quot; (XX-coma-XXX-point-XX) I will get those Error, and I don't know why.</p>
  <p>Please help me.
  Thank you.</p>