title: How to make this loop succesful after a succesful attempt?
body: <p>The retry function tries to execute an operation that might fail, it retries the operation for a number of attempts. Currently the code will keep executing the function even if it succeeds. Modify the code so that it stops trying after the operation succeeded.</p>
  
  <pre><code>def retry(operation, attempts):
    for n in range(attempts):
      if operation():
        print("Attempt " + str(n) + " succeeded")
      else:
        print("Attempt " + str(n) + " failed")
  
  retry(create_user, 3)
  retry(stop_service, 5)
  </code></pre>