Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

fonction nombre premier python

k = 13

# 1 not being a prime number, is ignored
if k > 1:
    for i in range(2, int(k/2)+1):
         if (k % i) == 0:
            print("It is not a prime number")
            break
    else:
        print("It is a prime number")

else:
    print("It is not a prime number")
Comment

PREVIOUS NEXT
Code Example
Python :: compare dates in python 
Python :: decode a qrcode inpython 
Python :: python get ids from array of objects 
Python :: qt designer python 
Python :: Check instance has an attribute in python 
Python :: set method in python 
Python :: python filter list with list of booleans 
Python :: logging python 
Python :: # unzip files 
Python :: websocket api python on close 
Python :: python if not none in one line 
Python :: change creation date filesystem py 
Python :: django form action 
Python :: pickle dump example 
Python :: Insert between Characters Python 
Python :: python if file exist 
Python :: pandas pull value from column 
Python :: if-else Conditional Statement in Python 
Python :: how to repeat a row in pandas 
Python :: python default value 
Python :: pandas show all dataframe method 
Python :: #Function in python 
Python :: quotation marks in string 
Python :: customise the django rest api view 
Python :: pypdf2 advanced tutorial 
Python :: read variable in a string python 
Python :: Convert Int to String Using format() method 
Python :: python conditionals 
Python :: Changing default fonts in matploitlibrc file 
Python :: scrape website with login python selenium 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =