title: Python string substitution showing 0.000 in print statement for floating point #
body: <p>I have this simple python code,</p>
  
  <pre><code>import time
  t1 = time.time()
  total = sum([x for x in range(1000) if x%3 is 0 or x%5 is 0])
  t2 =time.time()
  
  print "Ans is: %d, Time is %f" %(total,(t2-t1)*1000.0)
  </code></pre>
  
  <p>I get this as my output</p>
  
  <pre><code>Ans is: 233168, Time is 0.000000
  </code></pre>
  
  <p>How come I can't see the result of my number? I've googled other examples of substituting a number in a string and they do exactly what i'm doing, any help?</p>
  
  <p>I've also tried using %0.3f and %d as well....hmm... Thanks in advance for the help</p>
  
  <p>EDIT</p>
  
  <p>When I try this code:</p>
  
  <pre><code>import time
  t1 = time.time()
  total = sum([x for x in range(1000) if x%3 is 0 or x%5 is 0])
  t2 =time.time()
  print t2
  print "Ans is: %d, Time is %f" %(total,(t2-t1)*1000.0)
  </code></pre>
  
  <p>I get this answer,</p>
  
  <pre><code>1344350841.39
  Ans is: 233168, Time is 15.000105
  </code></pre>