title: Removing Trailing Zeros in Python
body: <p>I need to find a way to convert the following strings in python:</p>
  
  <pre><code>0.000       =&gt; 0
  0           =&gt; 0
  123.45000   =&gt; 123.45
  0000        =&gt; 0
  123.4506780 =&gt; 123.450678
  </code></pre>
  
  <p>and so forth. I tried .rstrip('0').rstrip('.'), but that doesn't work if the input is 0 or 00.</p>
  
  <p>Any ideas? Thanks!</p>