Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python decomposition facteur premier

n = 1 # n'importe quelle valeur sauf 0
while n!=0:
    n=int(input("Entrez un nombre entier:"))
    if n<0:
        print("n est négatif, erreur, recommencez")
    elif n>0:
        print("n est positif, suite du programme")
        d = 2
        while n>1:
            while n%d==0:
                n = n//d
                print("facteur trouvé:", d)
            d += 1
    print()    
print("Fin du programme")
Comment

PREVIOUS NEXT
Code Example
Python :: python build a string using reduce and concatenate 
Python :: python code to demonstrate inheritance with animal class 
Python :: colorbar with hist2d 
Python :: email confirmation django 
Python :: Python - Sort Lists 
Python :: groupby in python 
Python :: python try 
Python :: trim all new rows string python 
Python :: Prints all integers of a list 
Python :: show only integer values matplotlib 
Python :: Python update to beginning of dictionary 
Python :: smote on dataframe of feature 
Python :: changing database of django 
Python :: remove grid in imshow 
Python :: get last save id django model 
Python :: what is mustafa nickname 
Python :: python oneline if statement 
Python :: how to change theme of jupyter notebook 
Python :: pyqt popup yes no 
Python :: python get image RGB data from URL 
Python :: python raise exception with custom message 
Python :: python code to increase cpu utilization 
Python :: figure in matplotlib 
Python :: Getting the first element from each list in a column of lists 
Python :: from Player import Player 
Python :: python combinations function 
Python :: selenium session id python 
Python :: insert value in string python 
Python :: 151 uva problem solution 
Python :: parser.add_argument array python 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =