1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2025-05-18 12:02:53 +02:00

Add "is-prime-number" challenge

This commit is contained in:
Divlo
2020-07-05 22:20:45 +02:00
parent 888940a04c
commit 6a40154d93
5 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,4 @@
# python-prime - is-prime-number
Programming language : Python
Created by [@Divlo](https://github.com/Divlo) at 5 July 2020.

View File

@ -0,0 +1,10 @@
# Only the non-zero and positive divisors
def divider_list(number):
number_list = []
for index in range(1, number + 1):
if number % index == 0:
number_list.append(index)
return number_list
def solution(number):
return len(divider_list(number)) == 2