Answers for "find number of factors of a number python"

5

number of digits in a number python

n = 1234 //Any Random Number
digits = len(str(n)) //Saves the number of digits of n into the variable digits
Posted by: Guest on March-26-2020
-2

to find factors of a number in python

# Python Program to find the factors of a number

# This function computes the factor of the argument passed
def print_factors(x):
   print("The factors of",x,"are:")
   for i in range(1, x + 1):
       if x % i == 0:
           print(i)

num = 6

print_factors(num)
Posted by: Guest on November-03-2020

Code answers related to "find number of factors of a number python"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language