Reading Time: 1 minutes
Factors of a number in Python
Write a Python program to list out all factors of a number.
givenNumber = 27 for number in range(1, givenNumber + 1): if givenNumber % number == 0: print(number) ## 1 ## 3 ## 9 ## 27