title: Changing while loop to for loop
body: <p>I was wondering if this same code could be made with a <code>for loop</code> instead of a <code>while</code></p>
  
  <pre><code>d = 0.6
  b  = 0.0
  h = 0.0
  t = 0.0
  count = 0
  
  h = float(input("enter height: "))
  b = float(input("enter a number of bounces: "))
  
  t = h
  
  while count &lt; b:
      if count == b - 1:
          t += h * d
          #print(t)
      else:
          h = h * d
          t += h * 2
          #print(t)
      count += 1
      #print (t)
  print(t)
  </code></pre>