add task 105

This commit is contained in:
Grzegorz Rogozik 2020-01-12 13:59:58 +01:00
parent 0eb7cdcb14
commit 5b7228361e

View File

@ -3,12 +3,11 @@
"""Rozwiązanie zadania 105."""
def change_first(tuple_t, element_e):
"""Docstring for Pylint points"""
if not tuple_t:
return ()
tuple_list = list(tuple_t)
tuple_list[0] = element_e
new_tuple = tuple(tuple_list)
return new_tuple
def is_almost_prime(number, limit):
if number < 0:
return False
else:
for i in range(2, limit + 1):
if number % i == 0:
return False
return True