18 lines
362 B
Python
18 lines
362 B
Python
|
# -*- coding: utf-8 -*-
|
||
|
|
||
|
"""Rozwiązanie zadania 105."""
|
||
|
|
||
|
def is_almost_prime(number, limit):
|
||
|
"""Checks if number can not be divided with limit offset"""
|
||
|
if number < 0:
|
||
|
return False
|
||
|
|
||
|
for i in range(2, limit + 1):
|
||
|
if number%i == 0:
|
||
|
return False
|
||
|
|
||
|
return True
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
print is_almost_prime(5, 10)
|