Python Program to Compute Prime Factors of an Integer
numb=int(input('Enter the number: ')) ls=[] for i in range(2,numb): # This gives common factors if numb%i==0: ls.append(i) for i in range(len(ls)): s=0 for j in range(2,ls[i]): # From the common factor, we find the prime numbers if ls[i]%j==0: s+=1 if(s==0): print(ls[i])
Input:
Enter the number: 3999
Output:
3
31
43
Input:
Enter the number: 6000
Output:
2
3
5
Sample Output Pic ?
More Codes to Fcuk
- Alphabet pyramid
- Find prime numbers between lower and upper ranges
- Prime Factor
- Find the sum of positive even numbers
- An integer interval [a,b], Find the minimum size of a set S.
- Country A and B, how many years the population of A surpasses B.
- Identify pH level
- Find the Perfect Number
- Find out if a word is a palindrome or not
- Find next Palindrome of N number.
- The writing bot Question. A scientist has created a writing bot. Read and write activity needs to be captured.
- Total Number of Odds in the list
- Partition this string into as many parts as possible.
- Leap year
- LCM of two numbers
- Greatest of three numbers
- Find the Gravitational Force Acting Between Two Objects.
- Find the missing element in geometric progression
- Find the GCD Greatest common divisor
- convert a given float number to integer