generate functionThu, 09 Mar 2023

Let's go through all the numbers from a to b inclusive and display them on the screen, while the following conditions must be met: skip (do not display) numbers that are divisible by 2 or 3. if you meet a number that is a multiple of 777, you must force the loop to end, do not print this number itself Try not to use a for loop

def pr(a, b): for i in range(a, b+1): if i % 777 == 0: break elif i % 2 == 0 or i % 3 == 0: continue print(i) pr(1, 10)

Questions about programming?Chat with your personal AI assistant