Computer Science, asked by rneharachel, 19 days ago

Q2. Write the for loop logic to display the factors of a number num​

Answers

Answered by NotThareesh
1

Answer:

prompt = int(input("Enter a number: "))

def print_factors(number):

   for factor in range(1, number+1):

       if number % factor == 0:

           print(factor)

           

print_factors(prompt)

Similar questions