Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check if number is prime python

def check_if_prime():
    number = int(input("Enter number: "))
    
    prime_lists = [1,2,3]
    
    divisible_by = []
    if number in prime_lists:
        return divisible_by
    
    if number==0:
        return None
    
    for i in range(2,number):
        
        if number%i==0:
            divisible_by.append(i)
            
    return divisible_by
        
    
check_if_prime()
Source by en.wikipedia.org #
 
PREVIOUS NEXT
Tagged: #check #number #prime #python
ADD COMMENT
Topic
Name
8+1 =