# take inputs
      num = int(input('Enter number: '))
      # find prime factors
      for i in range(2, num + 1):
          if(num % i == 0):
              isPrime = 1
              for j in range(2, (i //2 + 1)):
                  if(i % j == 0):
                      isPrime = 0
                      break
              if (isPrime == 1):
                  print(i,end=' ')
      print('are the prime factors of number',num)
      

      Python language logo
      Prime Factors

      beginner
      maths

      To find the prime factors of a given number.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.