Recent | Popular
#python #forloops
def retry(operation, attempts): for n in range(attempts): if operation(): print("Attempt " + str(n) + " succeeded") break else: print("Attempt " + str(n) + " failed") retry(create_user, 3) retry(stop_service, 5)
def factorial(n): result = 1 for x in range(0,10): result = result * x return x for n in range(0,10): print(n, n*factorial(n+1))
Tue Feb 06 2024 06:34:10 GMT+0000 (Coordinated Universal Time) https://gist.github.com/Kimjunkuk/393a2b97d2d24d490d7d64c77173606e
Tue Feb 06 2024 06:22:51 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/60689743/factorial-code-does-not-return-product-of-integer-and-all-integers-before-it