Exercise 11 

Write a program in Python that asks the user to enter an integer n and display all the divisors of that number.


# Ask to type a value of the integer n
n = int(input("Type a value of the integer n "))
# run through all integers lower than n
for i in range(1,n+1):
# try if i is a divisor of n
print("the number ",i," is a divisor for the integer ",n)
Younes Derfoufi
One thought on “Solution Exercise 11”

Leave a Reply