N = 6
K = 3
count = 0
divisors = []
for i in range(1, N + 1):
    if N % i == 0:
        divisors.append(i)

if divisors[2] in divisors:
    print(divisors[2])
else:
    print("0")

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: