Phone

+919997782184

Email

support@roboticswithpython.com

Geeks of Coding

Join us on Telegram

#940
Abhishek TyagiAbhishek Tyagi
Keymaster

5. Write a script that prints the multiples of 7 between 0 and 100.
Print one multiple per line and avoid printing any numbers that aren’t multiples of 7.
Remember that 0 is also a multiple of 7

Answer-

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)