Triying to RESTART a part of code

Hi fellas! well, im triying to restart not the entire function here below, but just from one part as an option if the user dont want the entire count.

I’VE READING ARTICLES :sweat_smile: , I thank you for the support in advance :wink:

def justNumbersAndLoops(a):
  
  for a in range(10):
    print(a)
    
    if a == 3:
      op1 = input(f'the reached number is {3}, do you want to proceed?: ')
      if op1 == 'y':
        continue
        print(a)
      elif op1 == 'n':
        break
        #here is where my "restart" action should be!
        
        

print(justNumbersAndLoops(numbers))

Hi! well, the target is to give the user a chance of restart of the wole account.
you mean do something like this?:

pd: sorry, my fault, i forgot to insert the “numbers” value on the top of it…

numbers = 0


def justNumbersAndLoops(a):
  
  for a in range(10):
    print(a)
    
    if a == 3:
      op1 = input(f'the reached number is {3}, do you want to proceed?: ')
      if op1 == 'y':
        continue
        print(a)
      elif op1 == 'n':
        break
        justNumbersAndLoops(a)

print(justNumbersAndLoops(numbers))

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.