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 func(a, b): while a <= b: if a % 2 == 0 or a % 3 == 0: a += 1 else: print(a) a += 1 if a % 777 == 0: break print(func(1, 100))

Questions about programming?Chat with your personal AI assistant