Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
One possible program:
def count_divisors(n):
c = 0
for d in range(1, n + 1):
if n % d == 0:
c += 1
return c
print(count_divisors(6))